home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / commctrl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  185.0 KB  |  5,908 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * commctrl.h - - Interface for the Windows Common Controls                    *
  4. *                                                                             *
  5. * Version 1.2                                                                 *
  6. *                                                                             *
  7. * Copyright (c) 1991-1997, Microsoft Corp.      All rights reserved.          *
  8. *                                                                             *
  9. \*****************************************************************************/
  10.  
  11.  
  12. #ifndef _INC_COMMCTRL
  13. #define _INC_COMMCTRL
  14. #pragma option push -b
  15.  
  16. #ifndef _WIN32_IE
  17. #define _WIN32_IE 0x0400
  18. #else
  19. #if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
  20. #error _WIN32_IE setting conflicts with _WIN32_WINNT setting
  21. #endif
  22. #endif
  23.  
  24. #ifndef _HRESULT_DEFINED
  25. #define _HRESULT_DEFINED
  26. typedef LONG HRESULT;
  27. #endif // _HRESULT_DEFINED
  28.  
  29. #ifndef NOUSER
  30.  
  31.  
  32. //
  33. // Define API decoration for direct importing of DLL references.
  34. //
  35. #ifndef WINCOMMCTRLAPI
  36. #if !defined(_COMCTL32_) && defined(_WIN32)
  37. #define WINCOMMCTRLAPI DECLSPEC_IMPORT
  38. #else
  39. #define WINCOMMCTRLAPI
  40. #endif
  41. #endif // WINCOMMCTRLAPI
  42.  
  43. //
  44. // For compilers that don't support nameless unions
  45. //
  46. #ifndef DUMMYUNIONNAME
  47. #ifdef NONAMELESSUNION
  48. #define DUMMYUNIONNAME          u
  49. #define DUMMYUNIONNAME2         u2
  50. #define DUMMYUNIONNAME3         u3
  51. #else
  52. #define DUMMYUNIONNAME
  53. #define DUMMYUNIONNAME2
  54. #define DUMMYUNIONNAME3
  55. #endif
  56. #endif // DUMMYUNIONNAME
  57.  
  58. #ifdef _WIN32
  59. #include <pshpack1.h>
  60. #endif
  61.  
  62. #ifdef __cplusplus
  63. extern "C" {
  64. #endif
  65.  
  66. //
  67. // Users of this header may define any number of these constants to avoid
  68. // the definitions of each functional group.
  69. //
  70. //    NOTOOLBAR    Customizable bitmap-button toolbar control.
  71. //    NOUPDOWN     Up and Down arrow increment/decrement control.
  72. //    NOSTATUSBAR  Status bar control.
  73. //    NOMENUHELP   APIs to help manage menus, especially with a status bar.
  74. //    NOTRACKBAR   Customizable column-width tracking control.
  75. //    NODRAGLIST   APIs to make a listbox source and sink drag&drop actions.
  76. //    NOPROGRESS   Progress gas gauge.
  77. //    NOHOTKEY     HotKey control
  78. //    NOHEADER     Header bar control.
  79. //    NOIMAGEAPIS  ImageList apis.
  80. //    NOLISTVIEW   ListView control.
  81. //    NOTREEVIEW   TreeView control.
  82. //    NOTABCONTROL Tab control.
  83. //    NOANIMATE    Animate control.
  84. //
  85. //=============================================================================
  86.  
  87. #include <prsht.h>
  88.  
  89. #ifndef SNDMSG
  90. #ifdef __cplusplus
  91. #ifndef _MAC
  92. #define SNDMSG ::SendMessage
  93. #else
  94. #define SNDMSG ::AfxSendMessage
  95. #endif
  96. #else
  97. #ifndef _MAC
  98. #define SNDMSG SendMessage
  99. #else
  100. #define SNDMSG AfxSendMessage
  101. #endif //_MAC
  102. #endif
  103. #endif // ifndef SNDMSG
  104.  
  105. #ifdef _MAC
  106. #ifndef RC_INVOKED
  107. #ifndef _WLM_NOFORCE_LIBS
  108.  
  109. #ifndef _WLMDLL
  110.     #ifdef _DEBUG
  111.         #pragma comment(lib, "comctld.lib")
  112.     #else
  113.         #pragma comment(lib, "comctl.lib")
  114.     #endif
  115.     #pragma comment(linker, "/macres:comctl.rsc")
  116.     #else
  117.     #ifdef _DEBUG
  118.         #pragma comment(lib, "msvcctld.lib")
  119.     #else
  120.         #pragma comment(lib, "msvcctl.lib")
  121.     #endif
  122. #endif // _WLMDLL
  123.  
  124. #endif // _WLM_NOFORCE_LIBS
  125. #endif // RC_INVOKED
  126. #endif //_MAC
  127.  
  128. WINCOMMCTRLAPI void WINAPI InitCommonControls(void);
  129.  
  130. #if (_WIN32_IE >= 0x0300)
  131. typedef struct tagINITCOMMONCONTROLSEX {
  132.     DWORD dwSize;             // size of this structure
  133.     DWORD dwICC;              // flags indicating which classes to be initialized
  134. } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
  135. #define ICC_LISTVIEW_CLASSES 0x00000001 // listview, header
  136. #define ICC_TREEVIEW_CLASSES 0x00000002 // treeview, tooltips
  137. #define ICC_BAR_CLASSES      0x00000004 // toolbar, statusbar, trackbar, tooltips
  138. #define ICC_TAB_CLASSES      0x00000008 // tab, tooltips
  139. #define ICC_UPDOWN_CLASS     0x00000010 // updown
  140. #define ICC_PROGRESS_CLASS   0x00000020 // progress
  141. #define ICC_HOTKEY_CLASS     0x00000040 // hotkey
  142. #define ICC_ANIMATE_CLASS    0x00000080 // animate
  143. #define ICC_WIN95_CLASSES    0x000000FF
  144. #define ICC_DATE_CLASSES     0x00000100 // month picker, date picker, time picker, updown
  145. #define ICC_USEREX_CLASSES   0x00000200 // comboex
  146. #define ICC_COOL_CLASSES     0x00000400 // rebar (coolbar) control
  147. #if (_WIN32_IE >= 0x0400)
  148. #define ICC_INTERNET_CLASSES 0x00000800
  149. #define ICC_PAGESCROLLER_CLASS 0x00001000   // page scroller
  150. #define ICC_NATIVEFNTCTL_CLASS 0x00002000   // native font control
  151. #endif
  152. WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
  153. #endif      // _WIN32_IE >= 0x0300
  154.  
  155. #define ODT_HEADER              100
  156. #define ODT_TAB                 101
  157. #define ODT_LISTVIEW            102
  158.  
  159.  
  160. //====== Ranges for control message IDs =======================================
  161.  
  162. #define LVM_FIRST               0x1000      // ListView messages
  163. #define TV_FIRST                0x1100      // TreeView messages
  164. #define HDM_FIRST               0x1200      // Header messages
  165. #define TCM_FIRST               0x1300      // Tab control messages
  166.  
  167. #if (_WIN32_IE >= 0x0400)
  168. #define PGM_FIRST               0x1400      // Pager control messages
  169. #define CCM_FIRST               0x2000      // Common control shared messages
  170.  
  171.  
  172. #define CCM_SETBKCOLOR          (CCM_FIRST + 1) // lParam is bkColor
  173.  
  174. typedef struct tagCOLORSCHEME {
  175.    DWORD            dwSize;
  176.    COLORREF         clrBtnHighlight;       // highlight color
  177.    COLORREF         clrBtnShadow;          // shadow color
  178. } COLORSCHEME, *LPCOLORSCHEME;
  179.  
  180. #define CCM_SETCOLORSCHEME      (CCM_FIRST + 2) // lParam is color scheme
  181. #define CCM_GETCOLORSCHEME      (CCM_FIRST + 3) // fills in COLORSCHEME pointed to by lParam
  182. #define CCM_GETDROPTARGET       (CCM_FIRST + 4)
  183. #define CCM_SETUNICODEFORMAT    (CCM_FIRST + 5)
  184. #define CCM_GETUNICODEFORMAT    (CCM_FIRST + 6)
  185.  
  186. #endif
  187.  
  188. #if (_WIN32_IE >= 0x0400)
  189. // for tooltips
  190. #define INFOTIPSIZE 1024
  191. #endif
  192.  
  193. //====== WM_NOTIFY Macros =====================================================
  194.  
  195. #define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \
  196.     (fn)((hwnd), (int)(wParam), (NMHDR FAR*)(lParam))
  197. #define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) \
  198.     (LRESULT)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(idFrom), (LPARAM)(NMHDR FAR*)(pnmhdr))
  199.  
  200.  
  201. //====== Generic WM_NOTIFY notification codes =================================
  202.  
  203. #define NM_OUTOFMEMORY          (NM_FIRST-1)
  204. #define NM_CLICK                (NM_FIRST-2)    // uses NMCLICK struct
  205. #define NM_DBLCLK               (NM_FIRST-3)
  206. #define NM_RETURN               (NM_FIRST-4)
  207. #define NM_RCLICK               (NM_FIRST-5)    // uses NMCLICK struct
  208. #define NM_RDBLCLK              (NM_FIRST-6)
  209. #define NM_SETFOCUS             (NM_FIRST-7)
  210. #define NM_KILLFOCUS            (NM_FIRST-8)
  211. #if (_WIN32_IE >= 0x0300)
  212. #define NM_CUSTOMDRAW           (NM_FIRST-12)
  213. #define NM_HOVER                (NM_FIRST-13)
  214. #endif
  215. #if (_WIN32_IE >= 0x0400)
  216. #define NM_NCHITTEST            (NM_FIRST-14)   // uses NMMOUSE struct
  217. #define NM_KEYDOWN              (NM_FIRST-15)   // uses NMKEY struct
  218. #define NM_RELEASEDCAPTURE      (NM_FIRST-16)
  219. #define NM_SETCURSOR            (NM_FIRST-17)   // uses NMMOUSE struct
  220. #define NM_CHAR                 (NM_FIRST-18)   // uses NMCHAR struct
  221. #endif
  222.  
  223.  
  224. #ifndef CCSIZEOF_STRUCT
  225. #define CCSIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
  226. #endif
  227.  
  228. #if (_WIN32_IE >= 0x0400)
  229. //====== Generic WM_NOTIFY notification structures ============================
  230.  
  231. typedef struct tagNMMOUSE {
  232.     NMHDR   hdr;
  233.     DWORD   dwItemSpec;
  234.     DWORD   dwItemData;
  235.     POINT   pt;
  236.     DWORD   dwHitInfo; // any specifics about where on the item or control the mouse is
  237. } NMMOUSE, FAR* LPNMMOUSE;
  238.  
  239. typedef NMMOUSE NMCLICK;
  240. typedef LPNMMOUSE LPNMCLICK;
  241.  
  242. // Generic structure to request an object of a specific type.
  243.  
  244. typedef struct tagNMOBJECTNOTIFY {
  245.     NMHDR   hdr;
  246.     int     iItem;
  247. #ifdef __IID_DEFINED__
  248.     const IID *piid;
  249. #else
  250.     const void *piid;
  251. #endif
  252.     void *pObject;
  253.     HRESULT hResult;
  254.     DWORD dwFlags;    // control specific flags (hints as to where in iItem it hit)
  255. } NMOBJECTNOTIFY, *LPNMOBJECTNOTIFY;
  256.  
  257. // Generic structure for a key
  258.  
  259. typedef struct tagNMKEY
  260. {
  261.     NMHDR hdr;
  262.     UINT  nVKey;
  263.     UINT  uFlags;
  264. } NMKEY, FAR *LPNMKEY;
  265.  
  266. // Generic structure for a character
  267.  
  268. typedef struct tagNMCHAR {
  269.     NMHDR   hdr;
  270.     UINT    ch;
  271.     DWORD   dwItemPrev;     // Item previously selected 
  272.     DWORD   dwItemNext;     // Item to be selected
  273. } NMCHAR, FAR* LPNMCHAR;
  274.  
  275. #endif           // _WIN32_IE >= 0x0400
  276.  
  277. //====== WM_NOTIFY codes (NMHDR.code values) ==================================
  278.  
  279. #define NM_FIRST                (0U-  0U)       // generic to all controls
  280. #define NM_LAST                 (0U- 99U)
  281.  
  282. #define LVN_FIRST               (0U-100U)       // listview
  283. #define LVN_LAST                (0U-199U)
  284.  
  285. #define HDN_FIRST               (0U-300U)       // header
  286. #define HDN_LAST                (0U-399U)
  287.  
  288. #define TVN_FIRST               (0U-400U)       // treeview
  289. #define TVN_LAST                (0U-499U)
  290.  
  291. #define TTN_FIRST               (0U-520U)       // tooltips
  292. #define TTN_LAST                (0U-549U)
  293.  
  294. #define TCN_FIRST               (0U-550U)       // tab control
  295. #define TCN_LAST                (0U-580U)
  296.  
  297. // Shell reserved               (0U-580U) -  (0U-589U)
  298.  
  299. #define CDN_FIRST               (0U-601U)       // common dialog (new)
  300. #define CDN_LAST                (0U-699U)
  301.  
  302. #define TBN_FIRST               (0U-700U)       // toolbar
  303. #define TBN_LAST                (0U-720U)
  304.  
  305. #define UDN_FIRST               (0U-721)        // updown
  306. #define UDN_LAST                (0U-740)
  307. #if (_WIN32_IE >= 0x0300)
  308. #define MCN_FIRST               (0U-750U)       // monthcal
  309. #define MCN_LAST                (0U-759U)
  310.  
  311. #define DTN_FIRST               (0U-760U)       // datetimepick
  312. #define DTN_LAST                (0U-799U)
  313.  
  314. #define CBEN_FIRST              (0U-800U)       // combo box ex
  315. #define CBEN_LAST               (0U-830U)
  316.  
  317. #define RBN_FIRST               (0U-831U)       // rebar
  318. #define RBN_LAST                (0U-859U)
  319. #endif
  320.  
  321. #if (_WIN32_IE >= 0x0400)
  322. #define IPN_FIRST               (0U-860U)       // internet address
  323. #define IPN_LAST                (0U-879U)       // internet address
  324.  
  325. #define SBN_FIRST               (0U-880U)       // status bar
  326. #define SBN_LAST                (0U-899U)
  327.  
  328. #define PGN_FIRST               (0U-900U)       // Pager Control
  329. #define PGN_LAST                (0U-950U)
  330.  
  331. #endif
  332.  
  333. #define MSGF_COMMCTRL_BEGINDRAG     0x4200
  334. #define MSGF_COMMCTRL_SIZEHEADER    0x4201
  335. #define MSGF_COMMCTRL_DRAGSELECT    0x4202
  336. #define MSGF_COMMCTRL_TOOLBARCUST   0x4203
  337.  
  338. #if (_WIN32_IE >= 0x0300)
  339. //==================== CUSTOM DRAW ==========================================
  340.  
  341.  
  342. // custom draw return flags
  343. // values under 0x00010000 are reserved for global custom draw values.
  344. // above that are for specific controls
  345. #define CDRF_DODEFAULT          0x00000000
  346. #define CDRF_NEWFONT            0x00000002
  347. #define CDRF_SKIPDEFAULT        0x00000004
  348.  
  349.  
  350. #define CDRF_NOTIFYPOSTPAINT    0x00000010
  351. #define CDRF_NOTIFYITEMDRAW     0x00000020
  352. #if (_WIN32_IE >= 0x0400)
  353. #define CDRF_NOTIFYSUBITEMDRAW  0x00000020  // flags are the same, we can distinguish by context
  354. #endif
  355. #define CDRF_NOTIFYPOSTERASE    0x00000040
  356.  
  357. // drawstage flags
  358. // values under 0x00010000 are reserved for global custom draw values.
  359. // above that are for specific controls
  360. #define CDDS_PREPAINT           0x00000001
  361. #define CDDS_POSTPAINT          0x00000002
  362. #define CDDS_PREERASE           0x00000003
  363. #define CDDS_POSTERASE          0x00000004
  364. // the 0x000010000 bit means it's individual item specific
  365. #define CDDS_ITEM               0x00010000
  366. #define CDDS_ITEMPREPAINT       (CDDS_ITEM | CDDS_PREPAINT)
  367. #define CDDS_ITEMPOSTPAINT      (CDDS_ITEM | CDDS_POSTPAINT)
  368. #define CDDS_ITEMPREERASE       (CDDS_ITEM | CDDS_PREERASE)
  369. #define CDDS_ITEMPOSTERASE      (CDDS_ITEM | CDDS_POSTERASE)
  370. #if (_WIN32_IE >= 0x0400)
  371. #define CDDS_SUBITEM            0x00020000
  372. #endif
  373.  
  374.  
  375. // itemState flags
  376. #define CDIS_SELECTED       0x0001
  377. #define CDIS_GRAYED         0x0002
  378. #define CDIS_DISABLED       0x0004
  379. #define CDIS_CHECKED        0x0008
  380. #define CDIS_FOCUS          0x0010
  381. #define CDIS_DEFAULT        0x0020
  382. #define CDIS_HOT            0x0040
  383. #define CDIS_MARKED         0x0080
  384. #define CDIS_INDETERMINATE  0x0100
  385.  
  386. typedef struct tagNMCUSTOMDRAWINFO
  387. {
  388.     NMHDR hdr;
  389.     DWORD dwDrawStage;
  390.     HDC hdc;
  391.     RECT rc;
  392.     DWORD dwItemSpec;  // this is control specific, but it's how to specify an item.  valid only with CDDS_ITEM bit set
  393.     UINT  uItemState;
  394.     LPARAM lItemlParam;
  395. } NMCUSTOMDRAW, FAR * LPNMCUSTOMDRAW;
  396.  
  397.  
  398.  
  399. typedef struct tagNMTTCUSTOMDRAW
  400. {
  401.     NMCUSTOMDRAW nmcd;
  402.     UINT uDrawFlags;
  403. } NMTTCUSTOMDRAW, FAR * LPNMTTCUSTOMDRAW;
  404.  
  405. #endif      // _WIN32_IE >= 0x0300
  406.  
  407.  
  408. //====== IMAGE APIS ===========================================================
  409.  
  410. #ifndef NOIMAGEAPIS
  411.  
  412. #define CLR_NONE                0xFFFFFFFFL
  413. #define CLR_DEFAULT             0xFF000000L
  414.  
  415. struct _IMAGELIST;
  416. typedef struct _IMAGELIST NEAR* HIMAGELIST;
  417.  
  418. #if (_WIN32_IE >= 0x0300)
  419. typedef struct _IMAGELISTDRAWPARAMS {
  420.     DWORD       cbSize;
  421.     HIMAGELIST  himl;
  422.     int         i;
  423.     HDC         hdcDst;
  424.     int         x;
  425.     int         y;
  426.     int         cx;
  427.     int         cy;
  428.     int         xBitmap;        // x offest from the upperleft of bitmap
  429.     int         yBitmap;        // y offset from the upperleft of bitmap
  430.     COLORREF    rgbBk;
  431.     COLORREF    rgbFg;
  432.     UINT        fStyle;
  433.     DWORD       dwRop;
  434. } IMAGELISTDRAWPARAMS, FAR * LPIMAGELISTDRAWPARAMS;
  435. #endif      // _WIN32_IE >= 0x0300
  436.  
  437. #define ILC_MASK                0x0001
  438. #define ILC_COLOR               0x0000
  439. #define ILC_COLORDDB            0x00FE
  440. #define ILC_COLOR4              0x0004
  441. #define ILC_COLOR8              0x0008
  442. #define ILC_COLOR16             0x0010
  443. #define ILC_COLOR24             0x0018
  444. #define ILC_COLOR32             0x0020
  445. #define ILC_PALETTE             0x0800      // (not implemented)
  446.  
  447. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow);
  448. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Destroy(HIMAGELIST himl);
  449. WINCOMMCTRLAPI int         WINAPI ImageList_GetImageCount(HIMAGELIST himl);
  450. #if (_WIN32_IE >= 0x0300)
  451. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetImageCount(HIMAGELIST himl, UINT uNewCount);
  452. #endif
  453. WINCOMMCTRLAPI int         WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask);
  454. WINCOMMCTRLAPI int         WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, int i, HICON hicon);
  455. WINCOMMCTRLAPI COLORREF    WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk);
  456. WINCOMMCTRLAPI COLORREF    WINAPI ImageList_GetBkColor(HIMAGELIST himl);
  457. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetOverlayImage(HIMAGELIST himl, int iImage, int iOverlay);
  458.  
  459. #define     ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon)
  460.  
  461. #define ILD_NORMAL              0x0000
  462. #define ILD_TRANSPARENT         0x0001
  463. #define ILD_MASK                0x0010
  464. #define ILD_IMAGE               0x0020
  465. #if (_WIN32_IE >= 0x0300)
  466. #define ILD_ROP                 0x0040
  467. #endif
  468. #define ILD_BLEND25             0x0002
  469. #define ILD_BLEND50             0x0004
  470. #define ILD_OVERLAYMASK         0x0F00
  471. #define INDEXTOOVERLAYMASK(i)   ((i) << 8)
  472.  
  473. #define ILD_SELECTED            ILD_BLEND50
  474. #define ILD_FOCUS               ILD_BLEND25
  475. #define ILD_BLEND               ILD_BLEND50
  476. #define CLR_HILIGHT             CLR_DEFAULT
  477.  
  478. WINCOMMCTRLAPI BOOL WINAPI ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle);
  479.  
  480.  
  481. #ifdef _WIN32
  482.  
  483. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Replace(HIMAGELIST himl, int i, HBITMAP hbmImage, HBITMAP hbmMask);
  484. WINCOMMCTRLAPI int         WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask);
  485. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
  486. #if (_WIN32_IE >= 0x0300)
  487. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS* pimldp);
  488. #endif
  489. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Remove(HIMAGELIST himl, int i);
  490. WINCOMMCTRLAPI HICON       WINAPI ImageList_GetIcon(HIMAGELIST himl, int i, UINT flags);
  491. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_LoadImageA(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  492. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  493.  
  494. #ifdef UNICODE
  495. #define ImageList_LoadImage     ImageList_LoadImageW
  496. #else
  497. #define ImageList_LoadImage     ImageList_LoadImageA
  498. #endif
  499.  
  500. #if (_WIN32_IE >= 0x0300)
  501. #define ILCF_MOVE   (0x00000000)
  502. #define ILCF_SWAP   (0x00000001)
  503. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Copy(HIMAGELIST himlDst, int iDst, HIMAGELIST himlSrc, int iSrc, UINT uFlags);
  504. #endif
  505.  
  506. WINCOMMCTRLAPI BOOL        WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, int iTrack, int dxHotspot, int dyHotspot);
  507. WINCOMMCTRLAPI void        WINAPI ImageList_EndDrag();
  508. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragEnter(HWND hwndLock, int x, int y);
  509. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragLeave(HWND hwndLock);
  510. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragMove(int x, int y);
  511. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag, int iDrag, int dxHotspot, int dyHotspot);
  512.  
  513. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragShowNolock(BOOL fShow);
  514. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_GetDragImage(POINT FAR* ppt,POINT FAR* pptHotspot);
  515.  
  516. #define     ImageList_RemoveAll(himl) ImageList_Remove(himl, -1)
  517. #define     ImageList_ExtractIcon(hi, himl, i) ImageList_GetIcon(himl, i, 0)
  518. #define     ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask) ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0)
  519.  
  520. #ifdef __IStream_INTERFACE_DEFINED__
  521. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
  522. WINCOMMCTRLAPI BOOL       WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM pstm);
  523. #endif
  524.  
  525. typedef struct _IMAGEINFO
  526. {
  527.     HBITMAP hbmImage;
  528.     HBITMAP hbmMask;
  529.     int     Unused1;
  530.     int     Unused2;
  531.     RECT    rcImage;
  532. } IMAGEINFO, FAR *LPIMAGEINFO;
  533.  
  534. WINCOMMCTRLAPI BOOL        WINAPI ImageList_GetIconSize(HIMAGELIST himl, int FAR *cx, int FAR *cy);
  535. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetIconSize(HIMAGELIST himl, int cx, int cy);
  536. WINCOMMCTRLAPI BOOL        WINAPI ImageList_GetImageInfo(HIMAGELIST himl, int i, IMAGEINFO FAR* pImageInfo);
  537. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy);
  538. #if (_WIN32_IE >= 0x0400)
  539. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_Duplicate(HIMAGELIST himl);
  540. #endif
  541.  
  542.  
  543. #endif
  544.  
  545. #endif
  546.  
  547.  
  548. //====== HEADER CONTROL =======================================================
  549.  
  550. #ifndef NOHEADER
  551.  
  552. #ifdef _WIN32
  553. #define WC_HEADERA              "SysHeader32"
  554. #define WC_HEADERW              L"SysHeader32"
  555.  
  556. #ifdef UNICODE
  557. #define WC_HEADER               WC_HEADERW
  558. #else
  559. #define WC_HEADER               WC_HEADERA
  560. #endif
  561.  
  562. #else
  563. #define WC_HEADER               "SysHeader"
  564. #endif
  565.  
  566. // begin_r_commctrl
  567.  
  568. #define HDS_HORZ                0x0000
  569. #define HDS_BUTTONS             0x0002
  570. #if (_WIN32_IE >= 0x0300)
  571. #define HDS_HOTTRACK            0x0004
  572. #endif
  573. #define HDS_HIDDEN              0x0008
  574.  
  575. #if (_WIN32_IE >= 0x0300)
  576. #define HDS_DRAGDROP            0x0040
  577. #define HDS_FULLDRAG            0x0080
  578. #endif
  579.  
  580. // end_r_commctrl
  581.  
  582. #if (_WIN32_IE >= 0x0300)
  583. #define HD_ITEMA HDITEMA
  584. #define HD_ITEMW HDITEMW
  585. #else
  586. #define HDITEMW  HD_ITEMW
  587. #define HDITEMA  HD_ITEMA
  588. #endif
  589. #define HD_ITEM HDITEM
  590.  
  591. typedef struct _HD_ITEMA
  592. {
  593.     UINT    mask;
  594.     int     cxy;
  595.     LPSTR   pszText;
  596.     HBITMAP hbm;
  597.     int     cchTextMax;
  598.     int     fmt;
  599.     LPARAM  lParam;
  600. #if (_WIN32_IE >= 0x0300)
  601.     int     iImage;        // index of bitmap in ImageList
  602.     int     iOrder;        // where to draw this item
  603. #endif
  604. } HDITEMA, FAR * LPHDITEMA;
  605.  
  606. #define HDITEMA_V1_SIZE CCSIZEOF_STRUCT(HDITEMA, lParam)
  607. #define HDITEMW_V1_SIZE CCSIZEOF_STRUCT(HDITEMW, lParam)
  608.  
  609.  
  610. typedef struct _HD_ITEMW
  611. {
  612.     UINT    mask;
  613.     int     cxy;
  614.     LPWSTR   pszText;
  615.     HBITMAP hbm;
  616.     int     cchTextMax;
  617.     int     fmt;
  618.     LPARAM  lParam;
  619. #if (_WIN32_IE >= 0x0300)
  620.     int     iImage;        // index of bitmap in ImageList
  621.     int     iOrder;
  622. #endif
  623. } HDITEMW, FAR * LPHDITEMW;
  624.  
  625. #ifdef UNICODE
  626. #define HDITEM HDITEMW
  627. #define LPHDITEM LPHDITEMW
  628. #define HDITEM_V1_SIZE HDITEMW_V1_SIZE
  629. #else
  630. #define HDITEM HDITEMA
  631. #define LPHDITEM LPHDITEMA
  632. #define HDITEM_V1_SIZE HDITEMA_V1_SIZE
  633. #endif
  634.  
  635.  
  636. #define HDI_WIDTH               0x0001
  637. #define HDI_HEIGHT              HDI_WIDTH
  638. #define HDI_TEXT                0x0002
  639. #define HDI_FORMAT              0x0004
  640. #define HDI_LPARAM              0x0008
  641. #define HDI_BITMAP              0x0010
  642. #if (_WIN32_IE >= 0x0300)
  643. #define HDI_IMAGE               0x0020
  644. #define HDI_DI_SETITEM          0x0040
  645. #define HDI_ORDER               0x0080
  646. #endif
  647.  
  648. #define HDF_LEFT                0
  649. #define HDF_RIGHT               1
  650. #define HDF_CENTER              2
  651. #define HDF_JUSTIFYMASK         0x0003
  652. #define HDF_RTLREADING          4
  653.  
  654. #define HDF_OWNERDRAW           0x8000
  655. #define HDF_STRING              0x4000
  656. #define HDF_BITMAP              0x2000
  657. #if (_WIN32_IE >= 0x0300)
  658. #define HDF_BITMAP_ON_RIGHT     0x1000
  659. #define HDF_IMAGE               0x0800
  660. #endif
  661.  
  662. #define HDM_GETITEMCOUNT        (HDM_FIRST + 0)
  663. #define Header_GetItemCount(hwndHD) \
  664.     (int)SNDMSG((hwndHD), HDM_GETITEMCOUNT, 0, 0L)
  665.  
  666.  
  667. #define HDM_INSERTITEMA         (HDM_FIRST + 1)
  668. #define HDM_INSERTITEMW         (HDM_FIRST + 10)
  669.  
  670. #ifdef UNICODE
  671. #define HDM_INSERTITEM          HDM_INSERTITEMW
  672. #else
  673. #define HDM_INSERTITEM          HDM_INSERTITEMA
  674. #endif
  675.  
  676. #define Header_InsertItem(hwndHD, i, phdi) \
  677.     (int)SNDMSG((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  678.  
  679.  
  680. #define HDM_DELETEITEM          (HDM_FIRST + 2)
  681. #define Header_DeleteItem(hwndHD, i) \
  682.     (BOOL)SNDMSG((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(i), 0L)
  683.  
  684.  
  685. #define HDM_GETITEMA            (HDM_FIRST + 3)
  686. #define HDM_GETITEMW            (HDM_FIRST + 11)
  687.  
  688. #ifdef UNICODE
  689. #define HDM_GETITEM             HDM_GETITEMW
  690. #else
  691. #define HDM_GETITEM             HDM_GETITEMA
  692. #endif
  693.  
  694. #define Header_GetItem(hwndHD, i, phdi) \
  695.     (BOOL)SNDMSG((hwndHD), HDM_GETITEM, (WPARAM)(int)(i), (LPARAM)(HD_ITEM FAR*)(phdi))
  696.  
  697.  
  698. #define HDM_SETITEMA            (HDM_FIRST + 4)
  699. #define HDM_SETITEMW            (HDM_FIRST + 12)
  700.  
  701. #ifdef UNICODE
  702. #define HDM_SETITEM             HDM_SETITEMW
  703. #else
  704. #define HDM_SETITEM             HDM_SETITEMA
  705. #endif
  706.  
  707. #define Header_SetItem(hwndHD, i, phdi) \
  708.     (BOOL)SNDMSG((hwndHD), HDM_SETITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  709.  
  710. #if (_WIN32_IE >= 0x0300)
  711. #define HD_LAYOUT  HDLAYOUT
  712. #else
  713. #define HDLAYOUT   HD_LAYOUT
  714. #endif
  715.  
  716. typedef struct _HD_LAYOUT
  717. {
  718.     RECT FAR* prc;
  719.     WINDOWPOS FAR* pwpos;
  720. } HDLAYOUT, FAR *LPHDLAYOUT;
  721.  
  722.  
  723. #define HDM_LAYOUT              (HDM_FIRST + 5)
  724. #define Header_Layout(hwndHD, playout) \
  725.     (BOOL)SNDMSG((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout))
  726.  
  727.  
  728. #define HHT_NOWHERE             0x0001
  729. #define HHT_ONHEADER            0x0002
  730. #define HHT_ONDIVIDER           0x0004
  731. #define HHT_ONDIVOPEN           0x0008
  732. #define HHT_ABOVE               0x0100
  733. #define HHT_BELOW               0x0200
  734. #define HHT_TORIGHT             0x0400
  735. #define HHT_TOLEFT              0x0800
  736.  
  737. #if (_WIN32_IE >= 0x0300)
  738. #define HD_HITTESTINFO HDHITTESTINFO
  739. #else
  740. #define HDHITTESTINFO  HD_HITTESTINFO
  741. #endif
  742.  
  743. typedef struct _HD_HITTESTINFO
  744. {
  745.     POINT pt;
  746.     UINT flags;
  747.     int iItem;
  748. } HDHITTESTINFO, FAR *LPHDHITTESTINFO;
  749.  
  750.  
  751. #define HDM_HITTEST             (HDM_FIRST + 6)
  752.  
  753. #if (_WIN32_IE >= 0x0300)
  754.  
  755. #define HDM_GETITEMRECT         (HDM_FIRST + 7)
  756. #define Header_GetItemRect(hwnd, iItem, lprc) \
  757.         (BOOL)SNDMSG((hwnd), HDM_GETITEMRECT, (WPARAM)iItem, (LPARAM)lprc)
  758.  
  759. #define HDM_SETIMAGELIST        (HDM_FIRST + 8)
  760. #define Header_SetImageList(hwnd, himl) \
  761.         (HIMAGELIST)SNDMSG((hwnd), HDM_SETIMAGELIST, 0, (LPARAM)himl)
  762.  
  763. #define HDM_GETIMAGELIST        (HDM_FIRST + 9)
  764. #define Header_GetImageList(hwnd) \
  765.         (HIMAGELIST)SNDMSG((hwnd), HDM_GETIMAGELIST, 0, 0)
  766.  
  767.  
  768. #define HDM_ORDERTOINDEX        (HDM_FIRST + 15)
  769. #define Header_OrderToIndex(hwnd, i) \
  770.         (int)SNDMSG((hwnd), HDM_ORDERTOINDEX, (WPARAM)i, 0)
  771.  
  772. #define HDM_CREATEDRAGIMAGE     (HDM_FIRST + 16)  // wparam = which item (by index)
  773. #define Header_CreateDragImage(hwnd, i) \
  774.         (HIMAGELIST)SNDMSG((hwnd), HDM_CREATEDRAGIMAGE, (WPARAM)i, 0)
  775.  
  776. #define HDM_GETORDERARRAY       (HDM_FIRST + 17)
  777. #define Header_GetOrderArray(hwnd, iCount, lpi) \
  778.         (BOOL)SNDMSG((hwnd), HDM_GETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
  779.  
  780. #define HDM_SETORDERARRAY       (HDM_FIRST + 18)
  781. #define Header_SetOrderArray(hwnd, iCount, lpi) \
  782.         (BOOL)SNDMSG((hwnd), HDM_SETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
  783. // lparam = int array of size HDM_GETITEMCOUNT
  784. // the array specifies the order that all items should be displayed.
  785. // e.g.  { 2, 0, 1}
  786. // says the index 2 item should be shown in the 0ths position
  787. //      index 0 should be shown in the 1st position
  788. //      index 1 should be shown in the 2nd position
  789.  
  790.  
  791. #define HDM_SETHOTDIVIDER          (HDM_FIRST + 19)
  792. #define Header_SetHotDivider(hwnd, fPos, dw) \
  793.         (int)SNDMSG((hwnd), HDM_SETHOTDIVIDER, (WPARAM)fPos, (LPARAM)dw)
  794. // convenience message for external dragdrop
  795. // wParam = BOOL  specifying whether the lParam is a dwPos of the cursor
  796. //              position or the index of which divider to hotlight
  797. // lParam = depends on wParam  (-1 and wParm = FALSE turns off hotlight)
  798. #endif      // _WIN32_IE >= 0x0300
  799.  
  800. #if (_WIN32_IE >= 0x0400)
  801. #define HDM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
  802. #define Header_SetUnicodeFormat(hwnd, fUnicode)  \
  803.     (BOOL)SNDMSG((hwnd), HDM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  804.  
  805. #define HDM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
  806. #define Header_GetUnicodeFormat(hwnd)  \
  807.     (BOOL)SNDMSG((hwnd), HDM_GETUNICODEFORMAT, 0, 0)
  808. #endif
  809.  
  810. #define HDN_ITEMCHANGINGA       (HDN_FIRST-0)
  811. #define HDN_ITEMCHANGINGW       (HDN_FIRST-20)
  812. #define HDN_ITEMCHANGEDA        (HDN_FIRST-1)
  813. #define HDN_ITEMCHANGEDW        (HDN_FIRST-21)
  814. #define HDN_ITEMCLICKA          (HDN_FIRST-2)
  815. #define HDN_ITEMCLICKW          (HDN_FIRST-22)
  816. #define HDN_ITEMDBLCLICKA       (HDN_FIRST-3)
  817. #define HDN_ITEMDBLCLICKW       (HDN_FIRST-23)
  818. #define HDN_DIVIDERDBLCLICKA    (HDN_FIRST-5)
  819. #define HDN_DIVIDERDBLCLICKW    (HDN_FIRST-25)
  820. #define HDN_BEGINTRACKA         (HDN_FIRST-6)
  821. #define HDN_BEGINTRACKW         (HDN_FIRST-26)
  822. #define HDN_ENDTRACKA           (HDN_FIRST-7)
  823. #define HDN_ENDTRACKW           (HDN_FIRST-27)
  824. #define HDN_TRACKA              (HDN_FIRST-8)
  825. #define HDN_TRACKW              (HDN_FIRST-28)
  826. #if (_WIN32_IE >= 0x0300)
  827. #define HDN_GETDISPINFOA        (HDN_FIRST-9)
  828. #define HDN_GETDISPINFOW        (HDN_FIRST-29)
  829. #define HDN_BEGINDRAG           (HDN_FIRST-10)
  830. #define HDN_ENDDRAG             (HDN_FIRST-11)
  831. #endif
  832.  
  833. #ifdef UNICODE
  834. #define HDN_ITEMCHANGING         HDN_ITEMCHANGINGW
  835. #define HDN_ITEMCHANGED          HDN_ITEMCHANGEDW
  836. #define HDN_ITEMCLICK            HDN_ITEMCLICKW
  837. #define HDN_ITEMDBLCLICK         HDN_ITEMDBLCLICKW
  838. #define HDN_DIVIDERDBLCLICK      HDN_DIVIDERDBLCLICKW
  839. #define HDN_BEGINTRACK           HDN_BEGINTRACKW
  840. #define HDN_ENDTRACK             HDN_ENDTRACKW
  841. #define HDN_TRACK                HDN_TRACKW
  842. #if (_WIN32_IE >= 0x0300)
  843. #define HDN_GETDISPINFO          HDN_GETDISPINFOW
  844. #endif
  845. #else
  846. #define HDN_ITEMCHANGING         HDN_ITEMCHANGINGA
  847. #define HDN_ITEMCHANGED          HDN_ITEMCHANGEDA
  848. #define HDN_ITEMCLICK            HDN_ITEMCLICKA
  849. #define HDN_ITEMDBLCLICK         HDN_ITEMDBLCLICKA
  850. #define HDN_DIVIDERDBLCLICK      HDN_DIVIDERDBLCLICKA
  851. #define HDN_BEGINTRACK           HDN_BEGINTRACKA
  852. #define HDN_ENDTRACK             HDN_ENDTRACKA
  853. #define HDN_TRACK                HDN_TRACKA
  854. #if (_WIN32_IE >= 0x0300)
  855. #define HDN_GETDISPINFO          HDN_GETDISPINFOA
  856. #endif
  857. #endif
  858.  
  859.  
  860.  
  861. #if (_WIN32_IE >= 0x0300)
  862. #define HD_NOTIFYA              NMHEADERA
  863. #define HD_NOTIFYW              NMHEADERW
  864. #else
  865. #define tagNMHEADERA            _HD_NOTIFY
  866. #define NMHEADERA               HD_NOTIFYA
  867. #define tagHMHEADERW            _HD_NOTIFYW
  868. #define NMHEADERW               HD_NOTIFYW
  869. #endif
  870. #define HD_NOTIFY               NMHEADER
  871.  
  872. typedef struct tagNMHEADERA
  873. {
  874.     NMHDR   hdr;
  875.     int     iItem;
  876.     int     iButton;
  877.     HDITEMA FAR* pitem;
  878. }  NMHEADERA, FAR* LPNMHEADERA;
  879.  
  880.  
  881. typedef struct tagNMHEADERW
  882. {
  883.     NMHDR   hdr;
  884.     int     iItem;
  885.     int     iButton;
  886.     HDITEMW FAR* pitem;
  887. } NMHEADERW, FAR* LPNMHEADERW;
  888.  
  889. #ifdef UNICODE
  890. #define NMHEADER                NMHEADERW
  891. #define LPNMHEADER              LPNMHEADERW
  892. #else
  893. #define NMHEADER                NMHEADERA
  894. #define LPNMHEADER              LPNMHEADERA
  895. #endif
  896.  
  897. typedef struct tagNMHDDISPINFOW
  898. {
  899.     NMHDR   hdr;
  900.     int     iItem;
  901.     UINT    mask;
  902.     LPWSTR  pszText;
  903.     int     cchTextMax;
  904.     int     iImage;
  905.     LPARAM  lParam;
  906. } NMHDDISPINFOW, FAR* LPNMHDDISPINFOW;
  907.  
  908. typedef struct tagNMHDDISPINFOA
  909. {
  910.     NMHDR   hdr;
  911.     int     iItem;
  912.     UINT    mask;
  913.     LPSTR   pszText;
  914.     int     cchTextMax;
  915.     int     iImage;
  916.     LPARAM  lParam;
  917. } NMHDDISPINFOA, FAR* LPNMHDDISPINFOA;
  918.  
  919.  
  920. #ifdef UNICODE
  921. #define NMHDDISPINFO            NMHDDISPINFOW
  922. #define LPNMHDDISPINFO          LPNMHDDISPINFOW
  923. #else
  924. #define NMHDDISPINFO            NMHDDISPINFOA
  925. #define LPNMHDDISPINFO          LPNMHDDISPINFOA
  926. #endif
  927.  
  928. #endif      // NOHEADER
  929.  
  930.  
  931. //====== TOOLBAR CONTROL ======================================================
  932.  
  933. #ifndef NOTOOLBAR
  934.  
  935. #ifdef _WIN32
  936. #define TOOLBARCLASSNAMEW       L"ToolbarWindow32"
  937. #define TOOLBARCLASSNAMEA       "ToolbarWindow32"
  938.  
  939. #ifdef  UNICODE
  940. #define TOOLBARCLASSNAME        TOOLBARCLASSNAMEW
  941. #else
  942. #define TOOLBARCLASSNAME        TOOLBARCLASSNAMEA
  943. #endif
  944.  
  945. #else
  946. #define TOOLBARCLASSNAME        "ToolbarWindow"
  947. #endif
  948.  
  949. typedef struct _TBBUTTON {
  950.     int iBitmap;
  951.     int idCommand;
  952.     BYTE fsState;
  953.     BYTE fsStyle;
  954. #ifdef _WIN32
  955.     BYTE bReserved[2];
  956. #endif
  957.     DWORD dwData;
  958.     int iString;
  959. } TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
  960. typedef const TBBUTTON FAR* LPCTBBUTTON;
  961.  
  962.  
  963. typedef struct _COLORMAP {
  964.     COLORREF from;
  965.     COLORREF to;
  966. } COLORMAP, FAR* LPCOLORMAP;
  967.  
  968. WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps,
  969.                         HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons,
  970.                         int iNumButtons, int dxButton, int dyButton,
  971.                         int dxBitmap, int dyBitmap, UINT uStructSize);
  972.  
  973. WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, int idBitmap,
  974.                                   UINT wFlags, LPCOLORMAP lpColorMap,
  975.                                   int iNumMaps);
  976.  
  977. #define CMB_MASKED              0x02
  978.  
  979. #define TBSTATE_CHECKED         0x01
  980. #define TBSTATE_PRESSED         0x02
  981. #define TBSTATE_ENABLED         0x04
  982. #define TBSTATE_HIDDEN          0x08
  983. #define TBSTATE_INDETERMINATE   0x10
  984. #define TBSTATE_WRAP            0x20
  985. #if (_WIN32_IE >= 0x0300)
  986. #define TBSTATE_ELLIPSES        0x40
  987. #endif
  988. #if (_WIN32_IE >= 0x0400)
  989. #define TBSTATE_MARKED          0x80
  990. #endif
  991.  
  992. #define TBSTYLE_BUTTON          0x0000
  993. #define TBSTYLE_SEP             0x0001
  994. #define TBSTYLE_CHECK           0x0002
  995. #define TBSTYLE_GROUP           0x0004
  996. #define TBSTYLE_CHECKGROUP      (TBSTYLE_GROUP | TBSTYLE_CHECK)
  997. #if (_WIN32_IE >= 0x0300)
  998. #define TBSTYLE_DROPDOWN        0x0008
  999. #endif
  1000. #if (_WIN32_IE >= 0x0400)
  1001. #define TBSTYLE_AUTOSIZE        0x0010 // automatically calculate the cx of the button
  1002. #define TBSTYLE_NOPREFIX        0x0020 // if this button should not have accel prefix
  1003. #endif
  1004.  
  1005. #define TBSTYLE_TOOLTIPS        0x0100
  1006. #define TBSTYLE_WRAPABLE        0x0200
  1007. #define TBSTYLE_ALTDRAG         0x0400
  1008. #if (_WIN32_IE >= 0x0300)
  1009. #define TBSTYLE_FLAT            0x0800
  1010. #define TBSTYLE_LIST            0x1000
  1011. #define TBSTYLE_CUSTOMERASE     0x2000
  1012. #endif
  1013. #if (_WIN32_IE >= 0x0400)
  1014. #define TBSTYLE_REGISTERDROP    0x4000
  1015. #define TBSTYLE_TRANSPARENT     0x8000
  1016. #define TBSTYLE_EX_DRAWDDARROWS 0x00000001
  1017. #endif
  1018.  
  1019. #if (_WIN32_IE >= 0x0400)
  1020. // Custom Draw Structure
  1021. typedef struct _NMTBCUSTOMDRAW {
  1022.     NMCUSTOMDRAW nmcd;
  1023.     HBRUSH hbrMonoDither;
  1024.     HBRUSH hbrLines;                // For drawing lines on buttons
  1025.     HPEN hpenLines;                 // For drawing lines on buttons
  1026.  
  1027.     COLORREF clrText;               // Color of text
  1028.     COLORREF clrMark;               // Color of text bk when marked. (only if TBSTATE_MARKED)
  1029.     COLORREF clrTextHighlight;      // Color of text when highlighted
  1030.     COLORREF clrBtnFace;            // Background of the button
  1031.     COLORREF clrBtnHighlight;       // 3D highlight
  1032.     COLORREF clrHighlightHotTrack;  // In conjunction with fHighlightHotTrack
  1033.                                     // will cause button to highlight like a menu
  1034.     RECT rcText;                    // Rect for text
  1035.  
  1036.     int nStringBkMode;
  1037.     int nHLStringBkMode;
  1038. } NMTBCUSTOMDRAW, * LPNMTBCUSTOMDRAW;
  1039.  
  1040. // Toolbar custom draw return flags
  1041. #define TBCDRF_NOEDGES              0x00010000  // Don't draw button edges
  1042. #define TBCDRF_HILITEHOTTRACK       0x00020000  // Use color of the button bk when hottracked
  1043. #define TBCDRF_NOOFFSET             0x00040000  // Don't offset button if pressed
  1044. #define TBCDRF_NOMARK               0x00080000  // Don't draw default highlight of image/text for TBSTATE_MARKED
  1045. #define TBCDRF_NOETCHEDEFFECT       0x00100000  // Don't draw etched effect for disabled items
  1046.  
  1047. #endif
  1048.  
  1049. #define TB_ENABLEBUTTON         (WM_USER + 1)
  1050. #define TB_CHECKBUTTON          (WM_USER + 2)
  1051. #define TB_PRESSBUTTON          (WM_USER + 3)
  1052. #define TB_HIDEBUTTON           (WM_USER + 4)
  1053. #define TB_INDETERMINATE        (WM_USER + 5)
  1054. #if (_WIN32_IE >= 0x0400)
  1055. #define TB_MARKBUTTON           (WM_USER + 6)
  1056. #endif
  1057. #define TB_ISBUTTONENABLED      (WM_USER + 9)
  1058. #define TB_ISBUTTONCHECKED      (WM_USER + 10)
  1059. #define TB_ISBUTTONPRESSED      (WM_USER + 11)
  1060. #define TB_ISBUTTONHIDDEN       (WM_USER + 12)
  1061. #define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
  1062. #if (_WIN32_IE >= 0x0400)
  1063. #define TB_ISBUTTONHIGHLIGHTED  (WM_USER + 14)
  1064. #endif
  1065. #define TB_SETSTATE             (WM_USER + 17)
  1066. #define TB_GETSTATE             (WM_USER + 18)
  1067. #define TB_ADDBITMAP            (WM_USER + 19)
  1068.  
  1069. #ifdef _WIN32
  1070. typedef struct tagTBADDBITMAP {
  1071.         HINSTANCE       hInst;
  1072.         UINT            nID;
  1073. } TBADDBITMAP, *LPTBADDBITMAP;
  1074.  
  1075. #define HINST_COMMCTRL          ((HINSTANCE)-1)
  1076. #define IDB_STD_SMALL_COLOR     0
  1077. #define IDB_STD_LARGE_COLOR     1
  1078. #define IDB_VIEW_SMALL_COLOR    4
  1079. #define IDB_VIEW_LARGE_COLOR    5
  1080. #if (_WIN32_IE >= 0x0300)
  1081. #define IDB_HIST_SMALL_COLOR    8
  1082. #define IDB_HIST_LARGE_COLOR    9
  1083. #endif
  1084.  
  1085. // icon indexes for standard bitmap
  1086.  
  1087. #define STD_CUT                 0
  1088. #define STD_COPY                1
  1089. #define STD_PASTE               2
  1090. #define STD_UNDO                3
  1091. #define STD_REDOW               4
  1092. #define STD_DELETE              5
  1093. #define STD_FILENEW             6
  1094. #define STD_FILEOPEN            7
  1095. #define STD_FILESAVE            8
  1096. #define STD_PRINTPRE            9
  1097. #define STD_PROPERTIES          10
  1098. #define STD_HELP                11
  1099. #define STD_FIND                12
  1100. #define STD_REPLACE             13
  1101. #define STD_PRINT               14
  1102.  
  1103. // icon indexes for standard view bitmap
  1104.  
  1105. #define VIEW_LARGEICONS         0
  1106. #define VIEW_SMALLICONS         1
  1107. #define VIEW_LIST               2
  1108. #define VIEW_DETAILS            3
  1109. #define VIEW_SORTNAME           4
  1110. #define VIEW_SORTSIZE           5
  1111. #define VIEW_SORTDATE           6
  1112. #define VIEW_SORTTYPE           7
  1113. #define VIEW_PARENTFOLDER       8
  1114. #define VIEW_NETCONNECT         9
  1115. #define VIEW_NETDISCONNECT      10
  1116. #define VIEW_NEWFOLDER          11
  1117. #if (_WIN32_IE >= 0x0400)
  1118. #define VIEW_VIEWMENU           12
  1119. #endif
  1120.  
  1121. #if (_WIN32_IE >= 0x0300)
  1122. #define HIST_BACK               0
  1123. #define HIST_FORWARD            1
  1124. #define HIST_FAVORITES          2
  1125. #define HIST_ADDTOFAVORITES     3
  1126. #define HIST_VIEWTREE           4
  1127. #endif
  1128.  
  1129. #endif
  1130.  
  1131. #if (_WIN32_IE >= 0x0400)
  1132. #define TB_ADDBUTTONSA          (WM_USER + 20)
  1133. #define TB_INSERTBUTTONA        (WM_USER + 21)
  1134. #else
  1135. #define TB_ADDBUTTONS           (WM_USER + 20)
  1136. #define TB_INSERTBUTTON         (WM_USER + 21)
  1137. #endif
  1138.  
  1139. #define TB_DELETEBUTTON         (WM_USER + 22)
  1140. #define TB_GETBUTTON            (WM_USER + 23)
  1141. #define TB_BUTTONCOUNT          (WM_USER + 24)
  1142. #define TB_COMMANDTOINDEX       (WM_USER + 25)
  1143.  
  1144. #ifdef _WIN32
  1145.  
  1146. typedef struct tagTBSAVEPARAMSA {
  1147.     HKEY hkr;
  1148.     LPCSTR pszSubKey;
  1149.     LPCSTR pszValueName;
  1150. } TBSAVEPARAMSA, FAR* LPTBSAVEPARAMSA;
  1151.  
  1152. typedef struct tagTBSAVEPARAMSW {
  1153.     HKEY hkr;
  1154.     LPCWSTR pszSubKey;
  1155.     LPCWSTR pszValueName;
  1156. } TBSAVEPARAMSW, FAR *LPTBSAVEPARAMW;
  1157.  
  1158. #ifdef UNICODE
  1159. #define TBSAVEPARAMS            TBSAVEPARAMSW
  1160. #define LPTBSAVEPARAMS          LPTBSAVEPARAMSW
  1161. #else
  1162. #define TBSAVEPARAMS            TBSAVEPARAMSA
  1163. #define LPTBSAVEPARAMS          LPTBSAVEPARAMSA
  1164. #endif
  1165.  
  1166. #endif  // _WIN32
  1167.  
  1168. #define TB_SAVERESTOREA         (WM_USER + 26)
  1169. #define TB_SAVERESTOREW         (WM_USER + 76)
  1170. #define TB_CUSTOMIZE            (WM_USER + 27)
  1171. #define TB_ADDSTRINGA           (WM_USER + 28)
  1172. #define TB_ADDSTRINGW           (WM_USER + 77)
  1173. #define TB_GETITEMRECT          (WM_USER + 29)
  1174. #define TB_BUTTONSTRUCTSIZE     (WM_USER + 30)
  1175. #define TB_SETBUTTONSIZE        (WM_USER + 31)
  1176. #define TB_SETBITMAPSIZE        (WM_USER + 32)
  1177. #define TB_AUTOSIZE             (WM_USER + 33)
  1178. #define TB_GETTOOLTIPS          (WM_USER + 35)
  1179. #define TB_SETTOOLTIPS          (WM_USER + 36)
  1180. #define TB_SETPARENT            (WM_USER + 37)
  1181. #define TB_SETROWS              (WM_USER + 39)
  1182. #define TB_GETROWS              (WM_USER + 40)
  1183. #define TB_SETCMDID             (WM_USER + 42)
  1184. #define TB_CHANGEBITMAP         (WM_USER + 43)
  1185. #define TB_GETBITMAP            (WM_USER + 44)
  1186. #define TB_GETBUTTONTEXTA       (WM_USER + 45)
  1187. #define TB_GETBUTTONTEXTW       (WM_USER + 75)
  1188. #define TB_REPLACEBITMAP        (WM_USER + 46)
  1189. #if (_WIN32_IE >= 0x0300)
  1190. #define TB_SETINDENT            (WM_USER + 47)
  1191. #define TB_SETIMAGELIST         (WM_USER + 48)
  1192. #define TB_GETIMAGELIST         (WM_USER + 49)
  1193. #define TB_LOADIMAGES           (WM_USER + 50)
  1194. #define TB_GETRECT              (WM_USER + 51) // wParam is the Cmd instead of index
  1195. #define TB_SETHOTIMAGELIST      (WM_USER + 52)
  1196. #define TB_GETHOTIMAGELIST      (WM_USER + 53)
  1197. #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
  1198. #define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
  1199. #define TB_SETSTYLE             (WM_USER + 56)
  1200. #define TB_GETSTYLE             (WM_USER + 57)
  1201. #define TB_GETBUTTONSIZE        (WM_USER + 58)
  1202. #define TB_SETBUTTONWIDTH       (WM_USER + 59)
  1203. #define TB_SETMAXTEXTROWS       (WM_USER + 60)
  1204. #define TB_GETTEXTROWS          (WM_USER + 61)
  1205. #endif      // _WIN32_IE >= 0x0300
  1206.  
  1207. #ifdef UNICODE
  1208. #define TB_GETBUTTONTEXT        TB_GETBUTTONTEXTW
  1209. #define TB_SAVERESTORE          TB_SAVERESTOREW
  1210. #define TB_ADDSTRING            TB_ADDSTRINGW
  1211. #else
  1212. #define TB_GETBUTTONTEXT        TB_GETBUTTONTEXTA
  1213. #define TB_SAVERESTORE          TB_SAVERESTOREA
  1214. #define TB_ADDSTRING            TB_ADDSTRINGA
  1215. #endif
  1216. #if (_WIN32_IE >= 0x0400)
  1217. #define TB_GETOBJECT            (WM_USER + 62)  // wParam == IID, lParam void **ppv
  1218. #define TB_GETHOTITEM           (WM_USER + 71)
  1219. #define TB_SETHOTITEM           (WM_USER + 72)  // wParam == iHotItem
  1220. #define TB_SETANCHORHIGHLIGHT   (WM_USER + 73)  // wParam == TRUE/FALSE
  1221. #define TB_GETANCHORHIGHLIGHT   (WM_USER + 74)
  1222. #define TB_MAPACCELERATORA      (WM_USER + 78)  // wParam == ch, lParam int * pidBtn
  1223.  
  1224. typedef struct {
  1225.     int   iButton;
  1226.     DWORD dwFlags;
  1227. } TBINSERTMARK, * LPTBINSERTMARK;
  1228. #define TBIMHT_AFTER      0x00000001 // TRUE = insert After iButton, otherwise before
  1229. #define TBIMHT_BACKGROUND 0x00000002 // TRUE iff missed buttons completely
  1230.  
  1231. #define TB_GETINSERTMARK        (WM_USER + 79)  // lParam == LPTBINSERTMARK
  1232. #define TB_SETINSERTMARK        (WM_USER + 80)  // lParam == LPTBINSERTMARK
  1233. #define TB_INSERTMARKHITTEST    (WM_USER + 81)  // wParam == LPPOINT lParam == LPTBINSERTMARK
  1234. #define TB_MOVEBUTTON           (WM_USER + 82)
  1235. #define TB_GETMAXSIZE           (WM_USER + 83)  // lParam == LPSIZE
  1236. #define TB_SETEXTENDEDSTYLE     (WM_USER + 84)  // For TBSTYLE_EX_*
  1237. #define TB_GETEXTENDEDSTYLE     (WM_USER + 85)  // For TBSTYLE_EX_*
  1238. #define TB_GETPADDING           (WM_USER + 86)
  1239. #define TB_SETPADDING           (WM_USER + 87)
  1240. #define TB_SETINSERTMARKCOLOR   (WM_USER + 88)
  1241. #define TB_GETINSERTMARKCOLOR   (WM_USER + 89)
  1242.  
  1243. #define TB_SETCOLORSCHEME       CCM_SETCOLORSCHEME  // lParam is color scheme
  1244. #define TB_GETCOLORSCHEME       CCM_GETCOLORSCHEME    // fills in COLORSCHEME pointed to by lParam
  1245.  
  1246. #define TB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  1247. #define TB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  1248.  
  1249. #define TB_MAPACCELERATORW      (WM_USER + 90)  // wParam == ch, lParam int * pidBtn
  1250. #ifdef UNICODE
  1251. #define TB_MAPACCELERATOR       TB_MAPACCELERATORW      
  1252. #else
  1253. #define TB_MAPACCELERATOR       TB_MAPACCELERATORA
  1254. #endif
  1255. #endif  // _WIN32_IE >= 0x0400
  1256.  
  1257. typedef struct {
  1258.     HINSTANCE       hInstOld;
  1259.     UINT            nIDOld;
  1260.     HINSTANCE       hInstNew;
  1261.     UINT            nIDNew;
  1262.     int             nButtons;
  1263. } TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
  1264.  
  1265. #ifdef _WIN32
  1266.  
  1267. #define TBBF_LARGE              0x0001
  1268.  
  1269. #define TB_GETBITMAPFLAGS       (WM_USER + 41)
  1270.  
  1271. #if (_WIN32_IE >= 0x0400)
  1272. #define TBIF_IMAGE              0x00000001
  1273. #define TBIF_TEXT               0x00000002
  1274. #define TBIF_STATE              0x00000004
  1275. #define TBIF_STYLE              0x00000008
  1276. #define TBIF_LPARAM             0x00000010
  1277. #define TBIF_COMMAND            0x00000020
  1278. #define TBIF_SIZE               0x00000040
  1279.  
  1280. typedef struct {
  1281.     UINT cbSize;
  1282.     DWORD dwMask;
  1283.     int idCommand;
  1284.     int iImage;
  1285.     BYTE fsState;
  1286.     BYTE fsStyle;
  1287.     WORD cx;
  1288.     DWORD lParam;
  1289.     LPSTR pszText;
  1290.     int cchText;
  1291. } TBBUTTONINFOA, *LPTBBUTTONINFOA;
  1292.  
  1293. typedef struct {
  1294.     UINT cbSize;
  1295.     DWORD dwMask;
  1296.     int idCommand;
  1297.     int iImage;
  1298.     BYTE fsState;
  1299.     BYTE fsStyle;
  1300.     WORD cx;
  1301.     DWORD lParam;
  1302.     LPWSTR pszText;
  1303.     int cchText;
  1304. } TBBUTTONINFOW, *LPTBBUTTONINFOW;
  1305.  
  1306. #ifdef UNICODE
  1307. #define TBBUTTONINFO TBBUTTONINFOW
  1308. #define LPTBBUTTONINFO LPTBBUTTONINFOW
  1309. #else
  1310. #define TBBUTTONINFO TBBUTTONINFOA
  1311. #define LPTBBUTTONINFO LPTBBUTTONINFOA
  1312. #endif
  1313.  
  1314.  
  1315. // BUTTONINFO APIs do NOT support the string pool.
  1316. #define TB_GETBUTTONINFOW        (WM_USER + 63)
  1317. #define TB_SETBUTTONINFOW        (WM_USER + 64)
  1318. #define TB_GETBUTTONINFOA        (WM_USER + 65)
  1319. #define TB_SETBUTTONINFOA        (WM_USER + 66)
  1320. #ifdef UNICODE
  1321. #define TB_GETBUTTONINFO        TB_GETBUTTONINFOW
  1322. #define TB_SETBUTTONINFO        TB_SETBUTTONINFOW
  1323. #else
  1324. #define TB_GETBUTTONINFO        TB_GETBUTTONINFOA
  1325. #define TB_SETBUTTONINFO        TB_SETBUTTONINFOA
  1326. #endif
  1327.  
  1328.  
  1329. #define TB_INSERTBUTTONW        (WM_USER + 67)
  1330. #define TB_ADDBUTTONSW          (WM_USER + 68)
  1331.  
  1332. #define TB_HITTEST              (WM_USER + 69)
  1333.  
  1334. // New post Win95/NT4 for InsertButton and AddButton.  if iString member
  1335. // is a pointer to a string, it will be handled as a string like listview
  1336. // (although LPSTR_TEXTCALLBACK is not supported).
  1337. #ifdef UNICODE
  1338. #define TB_INSERTBUTTON         TB_INSERTBUTTONW
  1339. #define TB_ADDBUTTONS           TB_ADDBUTTONSW
  1340. #else
  1341. #define TB_INSERTBUTTON         TB_INSERTBUTTONA
  1342. #define TB_ADDBUTTONS           TB_ADDBUTTONSA
  1343. #endif
  1344.  
  1345. #define TB_SETDRAWTEXTFLAGS     (WM_USER + 70)  // wParam == mask lParam == bit values
  1346.  
  1347. #endif         // _WIN32_IE >= 0x0400
  1348.  
  1349. #define TBN_GETBUTTONINFOA      (TBN_FIRST-0)
  1350. #define TBN_GETBUTTONINFOW      (TBN_FIRST-20)
  1351. #define TBN_BEGINDRAG           (TBN_FIRST-1)
  1352. #define TBN_ENDDRAG             (TBN_FIRST-2)
  1353. #define TBN_BEGINADJUST         (TBN_FIRST-3)
  1354. #define TBN_ENDADJUST           (TBN_FIRST-4)
  1355. #define TBN_RESET               (TBN_FIRST-5)
  1356. #define TBN_QUERYINSERT         (TBN_FIRST-6)
  1357. #define TBN_QUERYDELETE         (TBN_FIRST-7)
  1358. #define TBN_TOOLBARCHANGE       (TBN_FIRST-8)
  1359. #define TBN_CUSTHELP            (TBN_FIRST-9)
  1360. #if (_WIN32_IE >= 0x0300)
  1361. #define TBN_DROPDOWN            (TBN_FIRST - 10)
  1362. #endif
  1363. #if (_WIN32_IE >= 0x0400)
  1364. #define TBN_GETOBJECT           (TBN_FIRST - 12)
  1365.  
  1366. // Structure for TBN_HOTITEMCHANGE notification
  1367. //
  1368. typedef struct tagNMTBHOTITEM
  1369. {
  1370.     NMHDR   hdr;
  1371.     int     idOld;
  1372.     int     idNew;
  1373.     DWORD   dwFlags;           // HICF_*
  1374. } NMTBHOTITEM, * LPNMTBHOTITEM;
  1375.  
  1376. // Hot item change flags
  1377. #define HICF_OTHER          0x00000000
  1378. #define HICF_MOUSE          0x00000001          // Triggered by mouse
  1379. #define HICF_ARROWKEYS      0x00000002          // Triggered by arrow keys
  1380. #define HICF_ACCELERATOR    0x00000004          // Triggered by accelerator
  1381. #define HICF_DUPACCEL       0x00000008          // This accelerator is not unique
  1382. #define HICF_ENTERING       0x00000010          // idOld is invalid
  1383. #define HICF_LEAVING        0x00000020          // idNew is invalid
  1384. #define HICF_RESELECT       0x00000040          // hot item reselected
  1385.  
  1386.  
  1387. #define TBN_HOTITEMCHANGE       (TBN_FIRST - 13)
  1388. #define TBN_DRAGOUT             (TBN_FIRST - 14) // this is sent when the user clicks down on a button then drags off the button
  1389. #define TBN_DELETINGBUTTON      (TBN_FIRST - 15) // uses TBNOTIFY
  1390. #define TBN_GETDISPINFOA        (TBN_FIRST - 16) // This is sent when the  toolbar needs  some display information
  1391. #define TBN_GETDISPINFOW        (TBN_FIRST - 17) // This is sent when the  toolbar needs  some display information
  1392. #define TBN_GETINFOTIPA         (TBN_FIRST - 18)
  1393. #define TBN_GETINFOTIPW         (TBN_FIRST - 19)
  1394.  
  1395.  
  1396. typedef struct tagNMTBGETINFOTIPA
  1397. {
  1398.     NMHDR hdr;
  1399.     LPSTR pszText;
  1400.     int cchTextMax;
  1401.     int iItem;
  1402.     LPARAM lParam;
  1403. } NMTBGETINFOTIPA, *LPNMTBGETINFOTIPA;
  1404.  
  1405. typedef struct tagNMTBGETINFOTIPW
  1406. {
  1407.     NMHDR hdr;
  1408.     LPWSTR pszText;
  1409.     int cchTextMax;
  1410.     int iItem;
  1411.     LPARAM lParam;
  1412. } NMTBGETINFOTIPW, *LPNMTBGETINFOTIPW;
  1413.  
  1414. #ifdef UNICODE
  1415. #define TBN_GETINFOTIP          TBN_GETINFOTIPW
  1416. #define NMTBGETINFOTIP          NMTBGETINFOTIPW
  1417. #define LPNMTBGETINFOTIP        LPNMTBGETINFOTIPW
  1418. #else
  1419. #define TBN_GETINFOTIP          TBN_GETINFOTIPA
  1420. #define NMTBGETINFOTIP          NMTBGETINFOTIPA
  1421. #define LPNMTBGETINFOTIP        LPNMTBGETINFOTIPA
  1422. #endif
  1423.  
  1424. #define TBNF_IMAGE              0x00000001
  1425. #define TBNF_TEXT               0x00000002
  1426. #define TBNF_DI_SETITEM         0x10000000
  1427.  
  1428. typedef struct {
  1429.     NMHDR  hdr;
  1430.     DWORD dwMask;     // [in] Specifies the values requested .[out] Client ask the data to be set for future use
  1431.     int idCommand;    // [in] id of button we're requesting info for
  1432.     DWORD lParam;     // [in] lParam of button
  1433.     int iImage;       // [out] image index
  1434.     LPSTR pszText;    // [out] new text for item
  1435.     int cchText;      // [in] size of buffer pointed to by pszText
  1436. } NMTBDISPINFOA, *LPNMTBDISPINFOA;
  1437.  
  1438. typedef struct {
  1439.     NMHDR hdr;
  1440.     DWORD dwMask;      //[in] Specifies the values requested .[out] Client ask the data to be set for future use
  1441.     int idCommand;    // [in] id of button we're requesting info for
  1442.     DWORD lParam;     // [in] lParam of button
  1443.     int iImage;       // [out] image index
  1444.     LPWSTR pszText;   // [out] new text for item
  1445.     int cchText;      // [in] size of buffer pointed to by pszText
  1446. } NMTBDISPINFOW, *LPNMTBDISPINFOW;
  1447.  
  1448.  
  1449. #ifdef UNICODE
  1450. #define TBN_GETDISPINFO       TBN_GETDISPINFOW
  1451. #define NMTBDISPINFO          NMTBDISPINFOW
  1452. #define LPNMTBDISPINFO        LPNMTBDISPINFOW
  1453. #else
  1454. #define TBN_GETDISPINFO       TBN_GETDISPINFOA
  1455. #define NMTBDISPINFO          NMTBDISPINFOA
  1456. #define LPNMTBDISPINFO        LPNMTBDISPINFOA
  1457. #endif
  1458.  
  1459. // Return codes for TBN_DROPDOWN
  1460. #define TBDDRET_DEFAULT         0
  1461. #define TBDDRET_NODEFAULT       1
  1462. #define TBDDRET_TREATPRESSED    2       // Treat as a standard press button
  1463.  
  1464. #endif
  1465.  
  1466.  
  1467. #ifdef UNICODE
  1468. #define TBN_GETBUTTONINFO       TBN_GETBUTTONINFOW
  1469. #else
  1470. #define TBN_GETBUTTONINFO       TBN_GETBUTTONINFOA
  1471. #endif
  1472.  
  1473. #if (_WIN32_IE >= 0x0300)
  1474. #define TBNOTIFYA NMTOOLBARA
  1475. #define TBNOTIFYW NMTOOLBARW
  1476. #define LPTBNOTIFYA LPNMTOOLBARA
  1477. #define LPTBNOTIFYW LPNMTOOLBARW
  1478. #else
  1479. #define tagNMTOOLBARA  tagTBNOTIFYA
  1480. #define NMTOOLBARA     TBNOTIFYA
  1481. #define LPNMTOOLBARA   LPTBNOTIFYA
  1482. #define tagNMTOOLBARW  tagTBNOTIFYW
  1483. #define NMTOOLBARW     TBNOTIFYW
  1484. #define LPNMTOOLBARW   LPTBNOTIFYW
  1485. #endif
  1486.  
  1487. #define TBNOTIFY       NMTOOLBAR
  1488. #define LPTBNOTIFY     LPNMTOOLBAR
  1489.  
  1490. #if (_WIN32_IE >= 0x0300)
  1491. typedef struct tagNMTOOLBARA {
  1492.     NMHDR   hdr;
  1493.     int     iItem;
  1494.     TBBUTTON tbButton;
  1495.     int     cchText;
  1496.     LPSTR   pszText;
  1497. } NMTOOLBARA, FAR* LPNMTOOLBARA;
  1498. #endif
  1499.  
  1500.  
  1501. #if (_WIN32_IE >= 0x0300)
  1502. typedef struct tagNMTOOLBARW {
  1503.     NMHDR   hdr;
  1504.     int     iItem;
  1505.     TBBUTTON tbButton;
  1506.     int     cchText;
  1507.     LPWSTR   pszText;
  1508. } NMTOOLBARW, FAR* LPNMTOOLBARW;
  1509. #endif
  1510.  
  1511.  
  1512. #ifdef UNICODE
  1513. #define NMTOOLBAR               NMTOOLBARW
  1514. #define LPNMTOOLBAR             LPNMTOOLBARW
  1515. #else
  1516. #define NMTOOLBAR               NMTOOLBARA
  1517. #define LPNMTOOLBAR             LPNMTOOLBARA
  1518. #endif
  1519.  
  1520. #endif
  1521.  
  1522. #endif      // NOTOOLBAR
  1523.  
  1524.  
  1525. #if (_WIN32_IE >= 0x0300)
  1526. //====== REBAR CONTROL ========================================================
  1527.  
  1528. #ifndef NOREBAR
  1529.  
  1530. #ifdef _WIN32
  1531. #define REBARCLASSNAMEW         L"ReBarWindow32"
  1532. #define REBARCLASSNAMEA         "ReBarWindow32"
  1533.  
  1534. #ifdef  UNICODE
  1535. #define REBARCLASSNAME          REBARCLASSNAMEW
  1536. #else
  1537. #define REBARCLASSNAME          REBARCLASSNAMEA
  1538. #endif
  1539.  
  1540. #else
  1541. #define REBARCLASSNAME          "ReBarWindow"
  1542. #endif
  1543.  
  1544. #define RBIM_IMAGELIST  0x00000001
  1545.  
  1546. #if (_WIN32_IE >= 0x0400)
  1547. #define RBS_TOOLTIPS        0x0100
  1548. #define RBS_VARHEIGHT       0x0200
  1549. #define RBS_BANDBORDERS     0x0400
  1550. #define RBS_FIXEDORDER      0x0800
  1551. #define RBS_REGISTERDROP    0x1000
  1552. #define RBS_AUTOSIZE        0x2000
  1553. #define RBS_VERTICALGRIPPER 0x4000  // this always has the vertical gripper (default for horizontal mode)
  1554. #define RBS_DBLCLKTOGGLE    0x8000
  1555. #else
  1556. #define RBS_TOOLTIPS        0x00000100
  1557. #define RBS_VARHEIGHT       0x00000200
  1558. #define RBS_BANDBORDERS     0x00000400
  1559. #define RBS_FIXEDORDER      0x00000800
  1560. #endif      // _WIN32_IE >= 0x0400
  1561.  
  1562.  
  1563. typedef struct tagREBARINFO
  1564. {
  1565.     UINT        cbSize;
  1566.     UINT        fMask;
  1567. #ifndef NOIMAGEAPIS
  1568.     HIMAGELIST  himl;
  1569. #else
  1570.     HANDLE      himl;
  1571. #endif
  1572. }   REBARINFO, FAR *LPREBARINFO;
  1573.  
  1574. #define RBBS_BREAK          0x00000001  // break to new line
  1575. #define RBBS_FIXEDSIZE      0x00000002  // band can't be sized
  1576. #define RBBS_CHILDEDGE      0x00000004  // edge around top & bottom of child window
  1577. #define RBBS_HIDDEN         0x00000008  // don't show
  1578. #define RBBS_NOVERT         0x00000010  // don't show when vertical
  1579. #define RBBS_FIXEDBMP       0x00000020  // bitmap doesn't move during band resize
  1580. #if (_WIN32_IE >= 0x0400)
  1581. #define RBBS_VARIABLEHEIGHT 0x00000040  // allow autosizing of this child vertically
  1582. #define RBBS_GRIPPERALWAYS  0x00000080  // always show the gripper
  1583. #define RBBS_NOGRIPPER      0x00000100  // never show the gripper
  1584. #endif
  1585.  
  1586. #define RBBIM_STYLE         0x00000001
  1587. #define RBBIM_COLORS        0x00000002
  1588. #define RBBIM_TEXT          0x00000004
  1589. #define RBBIM_IMAGE         0x00000008
  1590. #define RBBIM_CHILD         0x00000010
  1591. #define RBBIM_CHILDSIZE     0x00000020
  1592. #define RBBIM_SIZE          0x00000040
  1593. #define RBBIM_BACKGROUND    0x00000080
  1594. #define RBBIM_ID            0x00000100
  1595. #if (_WIN32_IE >= 0x0400)
  1596. #define RBBIM_IDEALSIZE     0x00000200
  1597. #define RBBIM_LPARAM        0x00000400
  1598. #define RBBIM_HEADERSIZE    0x00000800  // control the size of the header
  1599. #endif
  1600.  
  1601. typedef struct tagREBARBANDINFOA
  1602. {
  1603.     UINT        cbSize;
  1604.     UINT        fMask;
  1605.     UINT        fStyle;
  1606.     COLORREF    clrFore;
  1607.     COLORREF    clrBack;
  1608.     LPSTR       lpText;
  1609.     UINT        cch;
  1610.     int         iImage;
  1611.     HWND        hwndChild;
  1612.     UINT        cxMinChild;
  1613.     UINT        cyMinChild;
  1614.     UINT        cx;
  1615.     HBITMAP     hbmBack;
  1616.     UINT        wID;
  1617. #if (_WIN32_IE >= 0x0400)
  1618.     UINT        cyChild;
  1619.     UINT        cyMaxChild;
  1620.     UINT        cyIntegral;
  1621.     UINT        cxIdeal;
  1622.     LPARAM      lParam;
  1623.     UINT        cxHeader;
  1624. #endif
  1625. }   REBARBANDINFOA, FAR *LPREBARBANDINFOA;
  1626. typedef REBARBANDINFOA CONST FAR *LPCREBARBANDINFOA;
  1627.  
  1628. #define REBARBANDINFOA_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA, wID)
  1629. #define REBARBANDINFOW_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW, wID)
  1630.  
  1631. typedef struct tagREBARBANDINFOW
  1632. {
  1633.     UINT        cbSize;
  1634.     UINT        fMask;
  1635.     UINT        fStyle;
  1636.     COLORREF    clrFore;
  1637.     COLORREF    clrBack;
  1638.     LPWSTR      lpText;
  1639.     UINT        cch;
  1640.     int         iImage;
  1641.     HWND        hwndChild;
  1642.     UINT        cxMinChild;
  1643.     UINT        cyMinChild;
  1644.     UINT        cx;
  1645.     HBITMAP     hbmBack;
  1646.     UINT        wID;
  1647. #if (_WIN32_IE >= 0x0400)
  1648.     UINT        cyChild;
  1649.     UINT        cyMaxChild;
  1650.     UINT        cyIntegral;
  1651.     UINT        cxIdeal;
  1652.     LPARAM      lParam;
  1653.     UINT        cxHeader;
  1654. #endif
  1655. }   REBARBANDINFOW, FAR *LPREBARBANDINFOW;
  1656. typedef REBARBANDINFOW CONST FAR *LPCREBARBANDINFOW;
  1657.  
  1658. #ifdef UNICODE
  1659. #define REBARBANDINFO       REBARBANDINFOW
  1660. #define LPREBARBANDINFO     LPREBARBANDINFOW
  1661. #define LPCREBARBANDINFO    LPCREBARBANDINFOW
  1662. #define REBARBANDINFO_V3_SIZE REBARBANDINFOW_V3_SIZE
  1663. #else
  1664. #define REBARBANDINFO       REBARBANDINFOA
  1665. #define LPREBARBANDINFO     LPREBARBANDINFOA
  1666. #define LPCREBARBANDINFO    LPCREBARBANDINFOA
  1667. #define REBARBANDINFO_V3_SIZE REBARBANDINFOA_V3_SIZE
  1668. #endif
  1669.  
  1670. #define RB_INSERTBANDA  (WM_USER +  1)
  1671. #define RB_DELETEBAND   (WM_USER +  2)
  1672. #define RB_GETBARINFO   (WM_USER +  3)
  1673. #define RB_SETBARINFO   (WM_USER +  4)
  1674. #if (_WIN32_IE < 0x0400)
  1675. #define RB_GETBANDINFO  (WM_USER +  5)
  1676. #endif
  1677. #define RB_SETBANDINFOA (WM_USER +  6)
  1678. #define RB_SETPARENT    (WM_USER +  7)
  1679. #if (_WIN32_IE >= 0x0400)
  1680. #define RB_HITTEST      (WM_USER +  8)
  1681. #define RB_GETRECT      (WM_USER +  9)
  1682. #endif
  1683. #define RB_INSERTBANDW  (WM_USER +  10)
  1684. #define RB_SETBANDINFOW (WM_USER +  11)
  1685. #define RB_GETBANDCOUNT (WM_USER +  12)
  1686. #define RB_GETROWCOUNT  (WM_USER +  13)
  1687. #define RB_GETROWHEIGHT (WM_USER +  14)
  1688. #if (_WIN32_IE >= 0x0400)
  1689. #define RB_IDTOINDEX    (WM_USER +  16) // wParam == id
  1690. #define RB_GETTOOLTIPS  (WM_USER +  17)
  1691. #define RB_SETTOOLTIPS  (WM_USER +  18)
  1692. #define RB_SETBKCOLOR   (WM_USER +  19) // sets the default BK color
  1693. #define RB_GETBKCOLOR   (WM_USER +  20) // defaults to CLR_NONE
  1694. #define RB_SETTEXTCOLOR (WM_USER +  21)
  1695. #define RB_GETTEXTCOLOR (WM_USER +  22) // defaults to 0x00000000
  1696. #define RB_SIZETORECT   (WM_USER +  23) // resize the rebar/break bands and such to this rect (lparam)
  1697. #endif      // _WIN32_IE >= 0x0400
  1698.  
  1699. #define RB_SETCOLORSCHEME   CCM_SETCOLORSCHEME  // lParam is color scheme
  1700. #define RB_GETCOLORSCHEME   CCM_GETCOLORSCHEME  // fills in COLORSCHEME pointed to by lParam
  1701.  
  1702. #ifdef UNICODE
  1703. #define RB_INSERTBAND   RB_INSERTBANDW
  1704. #define RB_SETBANDINFO   RB_SETBANDINFOW
  1705. #else
  1706. #define RB_INSERTBAND   RB_INSERTBANDA
  1707. #define RB_SETBANDINFO   RB_SETBANDINFOA
  1708. #endif
  1709.  
  1710. #if (_WIN32_IE >= 0x0400)
  1711. // for manual drag control
  1712. // lparam == cursor pos
  1713.         // -1 means do it yourself.
  1714.         // -2 means use what you had saved before
  1715. #define RB_BEGINDRAG    (WM_USER + 24)
  1716. #define RB_ENDDRAG      (WM_USER + 25)
  1717. #define RB_DRAGMOVE     (WM_USER + 26)
  1718. #define RB_GETBARHEIGHT (WM_USER + 27)
  1719. #define RB_GETBANDINFOW (WM_USER + 28)
  1720. #define RB_GETBANDINFOA (WM_USER + 29)
  1721.  
  1722. #ifdef UNICODE
  1723. #define RB_GETBANDINFO   RB_GETBANDINFOW
  1724. #else
  1725. #define RB_GETBANDINFO   RB_GETBANDINFOA
  1726. #endif
  1727.  
  1728. #define RB_MINIMIZEBAND (WM_USER + 30)
  1729. #define RB_MAXIMIZEBAND (WM_USER + 31)
  1730.  
  1731. #define RB_GETDROPTARGET (CCM_GETDROPTARGET)
  1732.  
  1733. #define RB_GETBANDBORDERS (WM_USER + 34)  // returns in lparam = lprc the amount of edges added to band wparam
  1734.  
  1735. #define RB_SHOWBAND     (WM_USER + 35)      // show/hide band
  1736. #define RB_SETPALETTE   (WM_USER + 37)
  1737. #define RB_GETPALETTE   (WM_USER + 38)
  1738. #define RB_MOVEBAND     (WM_USER + 39)
  1739.  
  1740. #define RB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  1741. #define RB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  1742.  
  1743. #endif      // _WIN32_IE >= 0x0400
  1744.  
  1745. #define RBN_HEIGHTCHANGE    (RBN_FIRST - 0)
  1746.  
  1747. #if (_WIN32_IE >= 0x0400)
  1748. #define RBN_GETOBJECT       (RBN_FIRST - 1)
  1749. #define RBN_LAYOUTCHANGED   (RBN_FIRST - 2)
  1750. #define RBN_AUTOSIZE        (RBN_FIRST - 3)
  1751. #define RBN_BEGINDRAG       (RBN_FIRST - 4)
  1752. #define RBN_ENDDRAG         (RBN_FIRST - 5)
  1753. #define RBN_DELETINGBAND    (RBN_FIRST - 6)     // Uses NMREBAR
  1754. #define RBN_DELETEDBAND     (RBN_FIRST - 7)     // Uses NMREBAR
  1755. #define RBN_CHILDSIZE       (RBN_FIRST - 8)
  1756.  
  1757.  
  1758. typedef struct tagNMREBARCHILDSIZE
  1759. {
  1760.     NMHDR hdr;
  1761.     UINT uBand;
  1762.     UINT wID;
  1763.     RECT rcChild;
  1764.     RECT rcBand;
  1765. } NMREBARCHILDSIZE, *LPNMREBARCHILDSIZE;
  1766.  
  1767. typedef struct tagNMREBAR
  1768. {
  1769.     NMHDR   hdr;
  1770.     DWORD   dwMask;           // RBNM_*
  1771.     UINT    uBand;
  1772.     UINT    fStyle;
  1773.     UINT    wID;
  1774.     LPARAM  lParam;
  1775. } NMREBAR, *LPNMREBAR;
  1776.  
  1777. // Mask flags for NMREBAR
  1778. #define RBNM_ID         0x00000001
  1779. #define RBNM_STYLE      0x00000002
  1780. #define RBNM_LPARAM     0x00000004
  1781.  
  1782.  
  1783. typedef struct tagNMRBAUTOSIZE
  1784. {
  1785.     NMHDR hdr;
  1786.     BOOL fChanged;
  1787.     RECT rcTarget;
  1788.     RECT rcActual;
  1789. } NMRBAUTOSIZE, *LPNMRBAUTOSIZE;
  1790.  
  1791. #define RBHT_NOWHERE    0x0001
  1792. #define RBHT_CAPTION    0x0002
  1793. #define RBHT_CLIENT     0x0003
  1794. #define RBHT_GRABBER    0x0004
  1795.  
  1796. typedef struct _RB_HITTESTINFO
  1797. {
  1798.     POINT pt;
  1799.     UINT flags;
  1800.     int iBand;
  1801. } RBHITTESTINFO, FAR *LPRBHITTESTINFO;
  1802.  
  1803. #endif      // _WIN32_IE >= 0x0400
  1804.  
  1805. #endif      // NOREBAR
  1806.  
  1807. #endif      // _WIN32_IE >= 0x0300
  1808.  
  1809. //====== TOOLTIPS CONTROL =====================================================
  1810.  
  1811. #ifndef NOTOOLTIPS
  1812.  
  1813. #ifdef _WIN32
  1814.  
  1815. #define TOOLTIPS_CLASSW         L"tooltips_class32"
  1816. #define TOOLTIPS_CLASSA         "tooltips_class32"
  1817.  
  1818. #ifdef UNICODE
  1819. #define TOOLTIPS_CLASS          TOOLTIPS_CLASSW
  1820. #else
  1821. #define TOOLTIPS_CLASS          TOOLTIPS_CLASSA
  1822. #endif
  1823.  
  1824. #else
  1825. #define TOOLTIPS_CLASS          "tooltips_class"
  1826. #endif
  1827.  
  1828. #if (_WIN32_IE >= 0x0300)
  1829. #define LPTOOLINFOA   LPTTTOOLINFOA
  1830. #define LPTOOLINFOW   LPTTTOOLINFOW
  1831. #define TOOLINFOA       TTTOOLINFOA
  1832. #define TOOLINFOW       TTTOOLINFOW
  1833. #else
  1834. #define   TTTOOLINFOA   TOOLINFOA
  1835. #define LPTTTOOLINFOA LPTOOLINFOA
  1836. #define   TTTOOLINFOW   TOOLINFOW
  1837. #define LPTTTOOLINFOW LPTOOLINFOW
  1838. #endif
  1839.  
  1840. #define LPTOOLINFO    LPTTTOOLINFO
  1841. #define TOOLINFO        TTTOOLINFO
  1842.  
  1843. #define TTTOOLINFOA_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA, lpszText)
  1844. #define TTTOOLINFOW_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW, lpszText)
  1845.  
  1846. typedef struct tagTOOLINFOA {
  1847.     UINT cbSize;
  1848.     UINT uFlags;
  1849.     HWND hwnd;
  1850.     UINT uId;
  1851.     RECT rect;
  1852.     HINSTANCE hinst;
  1853.     LPSTR lpszText;
  1854. #if (_WIN32_IE >= 0x0300)
  1855.     LPARAM lParam;
  1856. #endif
  1857. } TTTOOLINFOA, NEAR *PTOOLINFOA, FAR *LPTTTOOLINFOA;
  1858.  
  1859. typedef struct tagTOOLINFOW {
  1860.     UINT cbSize;
  1861.     UINT uFlags;
  1862.     HWND hwnd;
  1863.     UINT uId;
  1864.     RECT rect;
  1865.     HINSTANCE hinst;
  1866.     LPWSTR lpszText;
  1867. #if (_WIN32_IE >= 0x0300)
  1868.     LPARAM lParam;
  1869. #endif
  1870. } TTTOOLINFOW, NEAR *PTOOLINFOW, FAR* LPTTTOOLINFOW;
  1871.  
  1872. #ifdef UNICODE
  1873. #define TTTOOLINFO              TTTOOLINFOW
  1874. #define PTOOLINFO               PTOOLINFOW
  1875. #define LPTTTOOLINFO            LPTTTOOLINFOW
  1876. #define TTTOOLINFO_V1_SIZE TTTOOLINFOW_V1_SIZE
  1877. #else
  1878. #define PTOOLINFO               PTOOLINFOA
  1879. #define TTTOOLINFO              TTTOOLINFOA
  1880. #define LPTTTOOLINFO            LPTTTOOLINFOA
  1881. #define TTTOOLINFO_V1_SIZE TTTOOLINFOA_V1_SIZE
  1882. #endif
  1883.  
  1884. // begin_r_commctrl
  1885.  
  1886. #define TTS_ALWAYSTIP           0x01
  1887. #define TTS_NOPREFIX            0x02
  1888.  
  1889. // end_r_commctrl
  1890.  
  1891. #define TTF_IDISHWND            0x0001
  1892.  
  1893. // Use this to center around trackpoint in trackmode
  1894. // -OR- to center around tool in normal mode.
  1895. // Use TTF_ABSOLUTE to place the tip exactly at the track coords when
  1896. // in tracking mode.  TTF_ABSOLUTE can be used in conjunction with TTF_CENTERTIP
  1897. // to center the tip absolutely about the track point.
  1898.  
  1899. #define TTF_CENTERTIP           0x0002
  1900. #define TTF_RTLREADING          0x0004
  1901. #define TTF_SUBCLASS            0x0010
  1902. #if (_WIN32_IE >= 0x0300)
  1903. #define TTF_TRACK               0x0020
  1904. #define TTF_ABSOLUTE            0x0080
  1905. #define TTF_TRANSPARENT         0x0100
  1906. #define TTF_DI_SETITEM          0x8000       // valid only on the TTN_NEEDTEXT callback
  1907. #endif      // _WIN32_IE >= 0x0300
  1908.  
  1909. #define TTDT_AUTOMATIC          0
  1910. #define TTDT_RESHOW             1
  1911. #define TTDT_AUTOPOP            2
  1912. #define TTDT_INITIAL            3
  1913.  
  1914. #define TTM_ACTIVATE            (WM_USER + 1)
  1915. #define TTM_SETDELAYTIME        (WM_USER + 3)
  1916. #define TTM_ADDTOOLA            (WM_USER + 4)
  1917. #define TTM_ADDTOOLW            (WM_USER + 50)
  1918. #define TTM_DELTOOLA            (WM_USER + 5)
  1919. #define TTM_DELTOOLW            (WM_USER + 51)
  1920. #define TTM_NEWTOOLRECTA        (WM_USER + 6)
  1921. #define TTM_NEWTOOLRECTW        (WM_USER + 52)
  1922. #define TTM_RELAYEVENT          (WM_USER + 7)
  1923.  
  1924. #define TTM_GETTOOLINFOA        (WM_USER + 8)
  1925. #define TTM_GETTOOLINFOW        (WM_USER + 53)
  1926.  
  1927. #define TTM_SETTOOLINFOA        (WM_USER + 9)
  1928. #define TTM_SETTOOLINFOW        (WM_USER + 54)
  1929.  
  1930. #define TTM_HITTESTA            (WM_USER +10)
  1931. #define TTM_HITTESTW            (WM_USER +55)
  1932. #define TTM_GETTEXTA            (WM_USER +11)
  1933. #define TTM_GETTEXTW            (WM_USER +56)
  1934. #define TTM_UPDATETIPTEXTA      (WM_USER +12)
  1935. #define TTM_UPDATETIPTEXTW      (WM_USER +57)
  1936. #define TTM_GETTOOLCOUNT        (WM_USER +13)
  1937. #define TTM_ENUMTOOLSA          (WM_USER +14)
  1938. #define TTM_ENUMTOOLSW          (WM_USER +58)
  1939. #define TTM_GETCURRENTTOOLA     (WM_USER + 15)
  1940. #define TTM_GETCURRENTTOOLW     (WM_USER + 59)
  1941. #define TTM_WINDOWFROMPOINT     (WM_USER + 16)
  1942. #if (_WIN32_IE >= 0x0300)
  1943. #define TTM_TRACKACTIVATE       (WM_USER + 17)  // wParam = TRUE/FALSE start end  lparam = LPTOOLINFO
  1944. #define TTM_TRACKPOSITION       (WM_USER + 18)  // lParam = dwPos
  1945. #define TTM_SETTIPBKCOLOR       (WM_USER + 19)
  1946. #define TTM_SETTIPTEXTCOLOR     (WM_USER + 20)
  1947. #define TTM_GETDELAYTIME        (WM_USER + 21)
  1948. #define TTM_GETTIPBKCOLOR       (WM_USER + 22)
  1949. #define TTM_GETTIPTEXTCOLOR     (WM_USER + 23)
  1950. #define TTM_SETMAXTIPWIDTH      (WM_USER + 24)
  1951. #define TTM_GETMAXTIPWIDTH      (WM_USER + 25)
  1952. #define TTM_SETMARGIN           (WM_USER + 26)  // lParam = lprc
  1953. #define TTM_GETMARGIN           (WM_USER + 27)  // lParam = lprc
  1954. #define TTM_POP                 (WM_USER + 28)
  1955. #endif
  1956. #if (_WIN32_IE >= 0x0400)
  1957. #define TTM_UPDATE              (WM_USER + 29)
  1958. #endif
  1959.  
  1960.  
  1961. #ifdef UNICODE
  1962. #define TTM_ADDTOOL             TTM_ADDTOOLW
  1963. #define TTM_DELTOOL             TTM_DELTOOLW
  1964. #define TTM_NEWTOOLRECT         TTM_NEWTOOLRECTW
  1965. #define TTM_GETTOOLINFO         TTM_GETTOOLINFOW
  1966. #define TTM_SETTOOLINFO         TTM_SETTOOLINFOW
  1967. #define TTM_HITTEST             TTM_HITTESTW
  1968. #define TTM_GETTEXT             TTM_GETTEXTW
  1969. #define TTM_UPDATETIPTEXT       TTM_UPDATETIPTEXTW
  1970. #define TTM_ENUMTOOLS           TTM_ENUMTOOLSW
  1971. #define TTM_GETCURRENTTOOL      TTM_GETCURRENTTOOLW
  1972. #else
  1973. #define TTM_ADDTOOL             TTM_ADDTOOLA
  1974. #define TTM_DELTOOL             TTM_DELTOOLA
  1975. #define TTM_NEWTOOLRECT         TTM_NEWTOOLRECTA
  1976. #define TTM_GETTOOLINFO         TTM_GETTOOLINFOA
  1977. #define TTM_SETTOOLINFO         TTM_SETTOOLINFOA
  1978. #define TTM_HITTEST             TTM_HITTESTA
  1979. #define TTM_GETTEXT             TTM_GETTEXTA
  1980. #define TTM_UPDATETIPTEXT       TTM_UPDATETIPTEXTA
  1981. #define TTM_ENUMTOOLS           TTM_ENUMTOOLSA
  1982. #define TTM_GETCURRENTTOOL      TTM_GETCURRENTTOOLA
  1983. #endif
  1984.  
  1985.  
  1986. #if (_WIN32_IE >= 0x0300)
  1987. #define LPHITTESTINFOW    LPTTHITTESTINFOW
  1988. #define LPHITTESTINFOA    LPTTHITTESTINFOA
  1989. #else
  1990. #define LPTTHITTESTINFOA  LPHITTESTINFOA
  1991. #define LPTTHITTESTINFOW  LPHITTESTINFOW
  1992. #endif
  1993.  
  1994. #define LPHITTESTINFO     LPTTHITTESTINFO
  1995.  
  1996. typedef struct _TT_HITTESTINFOA {
  1997.     HWND hwnd;
  1998.     POINT pt;
  1999.     TTTOOLINFOA ti;
  2000. } TTHITTESTINFOA, FAR * LPTTHITTESTINFOA;
  2001.  
  2002. typedef struct _TT_HITTESTINFOW {
  2003.     HWND hwnd;
  2004.     POINT pt;
  2005.     TTTOOLINFOW ti;
  2006. } TTHITTESTINFOW, FAR * LPTTHITTESTINFOW;
  2007.  
  2008. #ifdef UNICODE
  2009. #define TTHITTESTINFO           TTHITTESTINFOW
  2010. #define LPTTHITTESTINFO         LPTTHITTESTINFOW
  2011. #else
  2012. #define TTHITTESTINFO           TTHITTESTINFOA
  2013. #define LPTTHITTESTINFO         LPTTHITTESTINFOA
  2014. #endif
  2015.  
  2016. #define TTN_GETDISPINFOA        (TTN_FIRST - 0)
  2017. #define TTN_GETDISPINFOW        (TTN_FIRST - 10)
  2018. #define TTN_SHOW                (TTN_FIRST - 1)
  2019. #define TTN_POP                 (TTN_FIRST - 2)
  2020.  
  2021. #ifdef UNICODE
  2022. #define TTN_GETDISPINFO         TTN_GETDISPINFOW
  2023. #else
  2024. #define TTN_GETDISPINFO         TTN_GETDISPINFOA
  2025. #endif
  2026.  
  2027. #define TTN_NEEDTEXT            TTN_GETDISPINFO
  2028. #define TTN_NEEDTEXTA           TTN_GETDISPINFOA
  2029. #define TTN_NEEDTEXTW           TTN_GETDISPINFOW
  2030.  
  2031. #if (_WIN32_IE >= 0x0300)
  2032. #define TOOLTIPTEXTW NMTTDISPINFOW
  2033. #define TOOLTIPTEXTA NMTTDISPINFOA
  2034. #define LPTOOLTIPTEXTA LPNMTTDISPINFOA
  2035. #define LPTOOLTIPTEXTW LPNMTTDISPINFOW
  2036. #else
  2037. #define tagNMTTDISPINFOA  tagTOOLTIPTEXTA
  2038. #define NMTTDISPINFOA     TOOLTIPTEXTA
  2039. #define LPNMTTDISPINFOA   LPTOOLTIPTEXTA
  2040. #define tagNMTTDISPINFOW  tagTOOLTIPTEXTW
  2041. #define NMTTDISPINFOW     TOOLTIPTEXTW
  2042. #define LPNMTTDISPINFOW   LPTOOLTIPTEXTW
  2043. #endif
  2044.  
  2045. #define TOOLTIPTEXT    NMTTDISPINFO
  2046. #define LPTOOLTIPTEXT  LPNMTTDISPINFO
  2047.  
  2048. #define NMTTDISPINFOA_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOA, uFlags)
  2049. #define NMTTDISPINFOW_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOW, uFlags)
  2050.  
  2051. typedef struct tagNMTTDISPINFOA {
  2052.     NMHDR hdr;
  2053.     LPSTR lpszText;
  2054.     char szText[80];
  2055.     HINSTANCE hinst;
  2056.     UINT uFlags;
  2057. #if (_WIN32_IE >= 0x0300)
  2058.     LPARAM lParam;
  2059. #endif
  2060. } NMTTDISPINFOA, FAR *LPNMTTDISPINFOA;
  2061.  
  2062. typedef struct tagNMTTDISPINFOW {
  2063.     NMHDR hdr;
  2064.     LPWSTR lpszText;
  2065.     WCHAR szText[80];
  2066.     HINSTANCE hinst;
  2067.     UINT uFlags;
  2068. #if (_WIN32_IE >= 0x0300)
  2069.     LPARAM lParam;
  2070. #endif
  2071. } NMTTDISPINFOW, FAR *LPNMTTDISPINFOW;
  2072.  
  2073. #ifdef UNICODE
  2074. #define NMTTDISPINFO            NMTTDISPINFOW
  2075. #define LPNMTTDISPINFO          LPNMTTDISPINFOW
  2076. #define NMTTDISPINFO_V1_SIZE NMTTDISPINFOW_V1_SIZE
  2077. #else
  2078. #define NMTTDISPINFO            NMTTDISPINFOA
  2079. #define LPNMTTDISPINFO          LPNMTTDISPINFOA
  2080. #define NMTTDISPINFO_V1_SIZE NMTTDISPINFOA_V1_SIZE
  2081. #endif
  2082.  
  2083. #endif      // NOTOOLTIPS
  2084.  
  2085.  
  2086. //====== STATUS BAR CONTROL ===================================================
  2087.  
  2088. #ifndef NOSTATUSBAR
  2089.  
  2090. // begin_r_commctrl
  2091.  
  2092. #define SBARS_SIZEGRIP          0x0100
  2093.  
  2094. // end_r_commctrl
  2095.  
  2096. WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR pszText, UINT uFlags);
  2097. WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR pszText, UINT uFlags);
  2098.  
  2099. WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID);
  2100. WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID);
  2101.  
  2102. #ifdef UNICODE
  2103. #define CreateStatusWindow      CreateStatusWindowW
  2104. #define DrawStatusText          DrawStatusTextW
  2105. #else
  2106. #define CreateStatusWindow      CreateStatusWindowA
  2107. #define DrawStatusText          DrawStatusTextA
  2108. #endif
  2109.  
  2110. #ifdef _WIN32
  2111. #define STATUSCLASSNAMEW        L"msctls_statusbar32"
  2112. #define STATUSCLASSNAMEA        "msctls_statusbar32"
  2113.  
  2114. #ifdef UNICODE
  2115. #define STATUSCLASSNAME         STATUSCLASSNAMEW
  2116. #else
  2117. #define STATUSCLASSNAME         STATUSCLASSNAMEA
  2118. #endif
  2119.  
  2120. #else
  2121. #define STATUSCLASSNAME         "msctls_statusbar"
  2122. #endif
  2123.  
  2124. #define SB_SETTEXTA             (WM_USER+1)
  2125. #define SB_SETTEXTW             (WM_USER+11)
  2126. #define SB_GETTEXTA             (WM_USER+2)
  2127. #define SB_GETTEXTW             (WM_USER+13)
  2128. #define SB_GETTEXTLENGTHA       (WM_USER+3)
  2129. #define SB_GETTEXTLENGTHW       (WM_USER+12)
  2130.  
  2131. #ifdef UNICODE
  2132. #define SB_GETTEXT              SB_GETTEXTW
  2133. #define SB_SETTEXT              SB_SETTEXTW
  2134. #define SB_GETTEXTLENGTH        SB_GETTEXTLENGTHW
  2135. #if (_WIN32_IE >= 0x0400)
  2136. #define SB_SETTIPTEXT           SB_SETTIPTEXTW
  2137. #define SB_GETTIPTEXT           SB_GETTIPTEXTW
  2138. #endif
  2139. #else
  2140. #define SB_GETTEXT              SB_GETTEXTA
  2141. #define SB_SETTEXT              SB_SETTEXTA
  2142. #define SB_GETTEXTLENGTH        SB_GETTEXTLENGTHA
  2143. #if (_WIN32_IE >= 0x0400)
  2144. #define SB_SETTIPTEXT           SB_SETTIPTEXTA
  2145. #define SB_GETTIPTEXT           SB_GETTIPTEXTA
  2146. #endif
  2147. #endif
  2148.  
  2149.  
  2150. #define SB_SETPARTS             (WM_USER+4)
  2151. #define SB_GETPARTS             (WM_USER+6)
  2152. #define SB_GETBORDERS           (WM_USER+7)
  2153. #define SB_SETMINHEIGHT         (WM_USER+8)
  2154. #define SB_SIMPLE               (WM_USER+9)
  2155. #define SB_GETRECT              (WM_USER+10)
  2156. #if (_WIN32_IE >= 0x0300)
  2157. #define SB_ISSIMPLE             (WM_USER+14)
  2158. #endif
  2159. #if (_WIN32_IE >= 0x0400)
  2160. #define SB_SETICON              (WM_USER+15)
  2161. #define SB_SETTIPTEXTA          (WM_USER+16)
  2162. #define SB_SETTIPTEXTW          (WM_USER+17)
  2163. #define SB_GETTIPTEXTA          (WM_USER+18)
  2164. #define SB_GETTIPTEXTW          (WM_USER+19)
  2165. #define SB_GETICON              (WM_USER+20)
  2166. #define SB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  2167. #define SB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  2168. #endif
  2169.  
  2170. #define SBT_OWNERDRAW            0x1000
  2171. #define SBT_NOBORDERS            0x0100
  2172. #define SBT_POPOUT               0x0200
  2173. #define SBT_RTLREADING           0x0400
  2174. #if (_WIN32_IE >= 0x0400)
  2175. #define SBT_TOOLTIPS             0x0800
  2176. #endif
  2177.  
  2178. #define SB_SETBKCOLOR           CCM_SETBKCOLOR      // lParam = bkColor
  2179.  
  2180. /// status bar notifications
  2181. #if (_WIN32_IE >= 0x0400)
  2182. #define SBN_SIMPLEMODECHANGE    (SBN_FIRST - 0)
  2183. #endif
  2184.  
  2185. #endif      // NOSTATUSBAR
  2186.  
  2187. //====== MENU HELP ============================================================
  2188.  
  2189. #ifndef NOMENUHELP
  2190.  
  2191. WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT FAR *lpwIDs);
  2192. WINCOMMCTRLAPI BOOL WINAPI ShowHideMenuCtl(HWND hWnd, UINT uFlags, LPINT lpInfo);
  2193. WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo);
  2194.  
  2195. #define MINSYSCOMMAND   SC_SIZE
  2196.  
  2197. #endif
  2198.  
  2199.  
  2200. //====== TRACKBAR CONTROL =====================================================
  2201.  
  2202. #ifndef NOTRACKBAR
  2203.  
  2204. #ifdef _WIN32
  2205.  
  2206. #define TRACKBAR_CLASSA         "msctls_trackbar32"
  2207. #define TRACKBAR_CLASSW         L"msctls_trackbar32"
  2208.  
  2209. #ifdef UNICODE
  2210. #define  TRACKBAR_CLASS         TRACKBAR_CLASSW
  2211. #else
  2212. #define  TRACKBAR_CLASS         TRACKBAR_CLASSA
  2213. #endif
  2214.  
  2215. #else
  2216. #define TRACKBAR_CLASS          "msctls_trackbar"
  2217. #endif
  2218.  
  2219.  
  2220. // begin_r_commctrl
  2221.  
  2222. #define TBS_AUTOTICKS           0x0001
  2223. #define TBS_VERT                0x0002
  2224. #define TBS_HORZ                0x0000
  2225. #define TBS_TOP                 0x0004
  2226. #define TBS_BOTTOM              0x0000
  2227. #define TBS_LEFT                0x0004
  2228. #define TBS_RIGHT               0x0000
  2229. #define TBS_BOTH                0x0008
  2230. #define TBS_NOTICKS             0x0010
  2231. #define TBS_ENABLESELRANGE      0x0020
  2232. #define TBS_FIXEDLENGTH         0x0040
  2233. #define TBS_NOTHUMB             0x0080
  2234. #if (_WIN32_IE >= 0x0300)
  2235. #define TBS_TOOLTIPS            0x0100
  2236. #endif
  2237.  
  2238. // end_r_commctrl
  2239.  
  2240. #define TBM_GETPOS              (WM_USER)
  2241. #define TBM_GETRANGEMIN         (WM_USER+1)
  2242. #define TBM_GETRANGEMAX         (WM_USER+2)
  2243. #define TBM_GETTIC              (WM_USER+3)
  2244. #define TBM_SETTIC              (WM_USER+4)
  2245. #define TBM_SETPOS              (WM_USER+5)
  2246. #define TBM_SETRANGE            (WM_USER+6)
  2247. #define TBM_SETRANGEMIN         (WM_USER+7)
  2248. #define TBM_SETRANGEMAX         (WM_USER+8)
  2249. #define TBM_CLEARTICS           (WM_USER+9)
  2250. #define TBM_SETSEL              (WM_USER+10)
  2251. #define TBM_SETSELSTART         (WM_USER+11)
  2252. #define TBM_SETSELEND           (WM_USER+12)
  2253. #define TBM_GETPTICS            (WM_USER+14)
  2254. #define TBM_GETTICPOS           (WM_USER+15)
  2255. #define TBM_GETNUMTICS          (WM_USER+16)
  2256. #define TBM_GETSELSTART         (WM_USER+17)
  2257. #define TBM_GETSELEND           (WM_USER+18)
  2258. #define TBM_CLEARSEL            (WM_USER+19)
  2259. #define TBM_SETTICFREQ          (WM_USER+20)
  2260. #define TBM_SETPAGESIZE         (WM_USER+21)
  2261. #define TBM_GETPAGESIZE         (WM_USER+22)
  2262. #define TBM_SETLINESIZE         (WM_USER+23)
  2263. #define TBM_GETLINESIZE         (WM_USER+24)
  2264. #define TBM_GETTHUMBRECT        (WM_USER+25)
  2265. #define TBM_GETCHANNELRECT      (WM_USER+26)
  2266. #define TBM_SETTHUMBLENGTH      (WM_USER+27)
  2267. #define TBM_GETTHUMBLENGTH      (WM_USER+28)
  2268. #if (_WIN32_IE >= 0x0300)
  2269. #define TBM_SETTOOLTIPS         (WM_USER+29)
  2270. #define TBM_GETTOOLTIPS         (WM_USER+30)
  2271. #define TBM_SETTIPSIDE          (WM_USER+31)
  2272. // TrackBar Tip Side flags
  2273. #define TBTS_TOP                0
  2274. #define TBTS_LEFT               1
  2275. #define TBTS_BOTTOM             2
  2276. #define TBTS_RIGHT              3
  2277.  
  2278. #define TBM_SETBUDDY            (WM_USER+32) // wparam = BOOL fLeft; (or right)
  2279. #define TBM_GETBUDDY            (WM_USER+33) // wparam = BOOL fLeft; (or right)
  2280. #endif
  2281. #if (_WIN32_IE >= 0x0400)
  2282. #define TBM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
  2283. #define TBM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
  2284. #endif
  2285.  
  2286.  
  2287. #define TB_LINEUP               0
  2288. #define TB_LINEDOWN             1
  2289. #define TB_PAGEUP               2
  2290. #define TB_PAGEDOWN             3
  2291. #define TB_THUMBPOSITION        4
  2292. #define TB_THUMBTRACK           5
  2293. #define TB_TOP                  6
  2294. #define TB_BOTTOM               7
  2295. #define TB_ENDTRACK             8
  2296.  
  2297.  
  2298. #if (_WIN32_IE >= 0x0300)
  2299. // custom draw item specs
  2300. #define TBCD_TICS    0x0001
  2301. #define TBCD_THUMB   0x0002
  2302. #define TBCD_CHANNEL 0x0003
  2303. #endif
  2304.  
  2305. #endif // trackbar
  2306.  
  2307. //====== DRAG LIST CONTROL ====================================================
  2308.  
  2309. #ifndef NODRAGLIST
  2310.  
  2311. typedef struct tagDRAGLISTINFO {
  2312.     UINT uNotification;
  2313.     HWND hWnd;
  2314.     POINT ptCursor;
  2315. } DRAGLISTINFO, FAR *LPDRAGLISTINFO;
  2316.  
  2317. #define DL_BEGINDRAG            (WM_USER+133)
  2318. #define DL_DRAGGING             (WM_USER+134)
  2319. #define DL_DROPPED              (WM_USER+135)
  2320. #define DL_CANCELDRAG           (WM_USER+136)
  2321.  
  2322. #define DL_CURSORSET            0
  2323. #define DL_STOPCURSOR           1
  2324. #define DL_COPYCURSOR           2
  2325. #define DL_MOVECURSOR           3
  2326.  
  2327. #define DRAGLISTMSGSTRING       TEXT("commctrl_DragListMsg")
  2328.  
  2329. WINCOMMCTRLAPI BOOL WINAPI MakeDragList(HWND hLB);
  2330. WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent, HWND hLB, int nItem);
  2331. WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB, POINT pt, BOOL bAutoScroll);
  2332.  
  2333. #endif
  2334.  
  2335.  
  2336. //====== UPDOWN CONTROL =======================================================
  2337.  
  2338. #ifndef NOUPDOWN
  2339.  
  2340. #ifdef _WIN32
  2341.  
  2342. #define UPDOWN_CLASSA           "msctls_updown32"
  2343. #define UPDOWN_CLASSW           L"msctls_updown32"
  2344.  
  2345. #ifdef UNICODE
  2346. #define  UPDOWN_CLASS           UPDOWN_CLASSW
  2347. #else
  2348. #define  UPDOWN_CLASS           UPDOWN_CLASSA
  2349. #endif
  2350.  
  2351. #else
  2352. #define UPDOWN_CLASS            "msctls_updown"
  2353. #endif
  2354.  
  2355.  
  2356. typedef struct _UDACCEL {
  2357.     UINT nSec;
  2358.     UINT nInc;
  2359. } UDACCEL, FAR *LPUDACCEL;
  2360.  
  2361. #define UD_MAXVAL               0x7fff
  2362. #define UD_MINVAL               (-UD_MAXVAL)
  2363.  
  2364. // begin_r_commctrl
  2365.  
  2366. #define UDS_WRAP                0x0001
  2367. #define UDS_SETBUDDYINT         0x0002
  2368. #define UDS_ALIGNRIGHT          0x0004
  2369. #define UDS_ALIGNLEFT           0x0008
  2370. #define UDS_AUTOBUDDY           0x0010
  2371. #define UDS_ARROWKEYS           0x0020
  2372. #define UDS_HORZ                0x0040
  2373. #define UDS_NOTHOUSANDS         0x0080
  2374. #if (_WIN32_IE >= 0x0300)
  2375. #define UDS_HOTTRACK            0x0100
  2376. #endif
  2377.  
  2378. // end_r_commctrl
  2379.  
  2380. #define UDM_SETRANGE            (WM_USER+101)
  2381. #define UDM_GETRANGE            (WM_USER+102)
  2382. #define UDM_SETPOS              (WM_USER+103)
  2383. #define UDM_GETPOS              (WM_USER+104)
  2384. #define UDM_SETBUDDY            (WM_USER+105)
  2385. #define UDM_GETBUDDY            (WM_USER+106)
  2386. #define UDM_SETACCEL            (WM_USER+107)
  2387. #define UDM_GETACCEL            (WM_USER+108)
  2388. #define UDM_SETBASE             (WM_USER+109)
  2389. #define UDM_GETBASE             (WM_USER+110)
  2390. #if (_WIN32_IE >= 0x0400)
  2391. #define UDM_SETRANGE32          (WM_USER+111)
  2392. #define UDM_GETRANGE32          (WM_USER+112) // wParam & lParam are LPINT
  2393. #define UDM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
  2394. #define UDM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
  2395. #endif
  2396.  
  2397. WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy,
  2398.                                 HWND hParent, int nID, HINSTANCE hInst,
  2399.                                 HWND hBuddy,
  2400.                                 int nUpper, int nLower, int nPos);
  2401.  
  2402. #if (_WIN32_IE >= 0x0300)
  2403. #define NM_UPDOWN      NMUPDOWN
  2404. #define LPNM_UPDOWN  LPNMUPDOWN
  2405. #else
  2406. #define NMUPDOWN      NM_UPDOWN
  2407. #define LPNMUPDOWN  LPNM_UPDOWN
  2408. #endif
  2409.  
  2410. typedef struct _NM_UPDOWN
  2411. {
  2412.     NMHDR hdr;
  2413.     int iPos;
  2414.     int iDelta;
  2415. } NMUPDOWN, FAR *LPNMUPDOWN;
  2416.  
  2417. #define UDN_DELTAPOS            (UDN_FIRST - 1)
  2418.  
  2419. #endif  // NOUPDOWN
  2420.  
  2421.  
  2422. //====== PROGRESS CONTROL =====================================================
  2423.  
  2424. #ifndef NOPROGRESS
  2425.  
  2426. #ifdef _WIN32
  2427.  
  2428. #define PROGRESS_CLASSA         "msctls_progress32"
  2429. #define PROGRESS_CLASSW         L"msctls_progress32"
  2430.  
  2431. #ifdef UNICODE
  2432. #define  PROGRESS_CLASS         PROGRESS_CLASSW
  2433. #else
  2434. #define  PROGRESS_CLASS         PROGRESS_CLASSA
  2435. #endif
  2436.  
  2437. #else
  2438. #define PROGRESS_CLASS          "msctls_progress"
  2439. #endif
  2440.  
  2441.  
  2442. #if (_WIN32_IE >= 0x0300)
  2443. #define PBS_SMOOTH              0x01
  2444. #define PBS_VERTICAL            0x04
  2445. #endif
  2446.  
  2447. #define PBM_SETRANGE            (WM_USER+1)
  2448. #define PBM_SETPOS              (WM_USER+2)
  2449. #define PBM_DELTAPOS            (WM_USER+3)
  2450. #define PBM_SETSTEP             (WM_USER+4)
  2451. #define PBM_STEPIT              (WM_USER+5)
  2452. #if (_WIN32_IE >= 0x0300)
  2453. #define PBM_SETRANGE32          (WM_USER+6)  // lParam = high, wParam = low
  2454. typedef struct
  2455. {
  2456.    int iLow;
  2457.    int iHigh;
  2458. } PBRANGE, *PPBRANGE;
  2459. #define PBM_GETRANGE            (WM_USER+7)  // wParam = return (TRUE ? low : high). lParam = PPBRANGE or NULL
  2460. #define PBM_GETPOS              (WM_USER+8)
  2461. #if (_WIN32_IE >= 0x0400)
  2462. #define PBM_SETBARCOLOR         (WM_USER+9)        // lParam = bar color
  2463. #endif      // _WIN32_IE >= 0x0400
  2464. #define PBM_SETBKCOLOR          CCM_SETBKCOLOR  // lParam = bkColor
  2465. #endif      // _WIN32_IE >= 0x0300
  2466.  
  2467. #endif  // NOPROGRESS
  2468.  
  2469.  
  2470. //====== HOTKEY CONTROL =======================================================
  2471.  
  2472. #ifndef NOHOTKEY
  2473.  
  2474. #define HOTKEYF_SHIFT           0x01
  2475. #define HOTKEYF_CONTROL         0x02
  2476. #define HOTKEYF_ALT             0x04
  2477. #ifdef _MAC
  2478. #define HOTKEYF_EXT             0x80
  2479. #else
  2480. #define HOTKEYF_EXT             0x08
  2481. #endif
  2482.  
  2483. #define HKCOMB_NONE             0x0001
  2484. #define HKCOMB_S                0x0002
  2485. #define HKCOMB_C                0x0004
  2486. #define HKCOMB_A                0x0008
  2487. #define HKCOMB_SC               0x0010
  2488. #define HKCOMB_SA               0x0020
  2489. #define HKCOMB_CA               0x0040
  2490. #define HKCOMB_SCA              0x0080
  2491.  
  2492.  
  2493. #define HKM_SETHOTKEY           (WM_USER+1)
  2494. #define HKM_GETHOTKEY           (WM_USER+2)
  2495. #define HKM_SETRULES            (WM_USER+3)
  2496.  
  2497. #ifdef _WIN32
  2498.  
  2499. #define HOTKEY_CLASSA           "msctls_hotkey32"
  2500. #define HOTKEY_CLASSW           L"msctls_hotkey32"
  2501.  
  2502. #ifdef UNICODE
  2503. #define HOTKEY_CLASS            HOTKEY_CLASSW
  2504. #else
  2505. #define HOTKEY_CLASS            HOTKEY_CLASSA
  2506. #endif
  2507.  
  2508. #else
  2509. #define HOTKEY_CLASS            "msctls_hotkey"
  2510. #endif
  2511.  
  2512. #endif  // NOHOTKEY
  2513.  
  2514. // begin_r_commctrl
  2515.  
  2516. //====== COMMON CONTROL STYLES ================================================
  2517.  
  2518. #define CCS_TOP                 0x00000001L
  2519. #define CCS_NOMOVEY             0x00000002L
  2520. #define CCS_BOTTOM              0x00000003L
  2521. #define CCS_NORESIZE            0x00000004L
  2522. #define CCS_NOPARENTALIGN       0x00000008L
  2523. #define CCS_ADJUSTABLE          0x00000020L
  2524. #define CCS_NODIVIDER           0x00000040L
  2525. #if (_WIN32_IE >= 0x0300)
  2526. #define CCS_VERT                0x00000080L
  2527. #define CCS_LEFT                (CCS_VERT | CCS_TOP)
  2528. #define CCS_RIGHT               (CCS_VERT | CCS_BOTTOM)
  2529. #define CCS_NOMOVEX             (CCS_VERT | CCS_NOMOVEY)
  2530. #endif
  2531.  
  2532. // end_r_commctrl
  2533.  
  2534. //====== LISTVIEW CONTROL =====================================================
  2535.  
  2536. #ifndef NOLISTVIEW
  2537.  
  2538. #ifdef _WIN32
  2539.  
  2540. #define WC_LISTVIEWA            "SysListView32"
  2541. #define WC_LISTVIEWW            L"SysListView32"
  2542.  
  2543. #ifdef UNICODE
  2544. #define WC_LISTVIEW             WC_LISTVIEWW
  2545. #else
  2546. #define WC_LISTVIEW             WC_LISTVIEWA
  2547. #endif
  2548.  
  2549. #else
  2550. #define WC_LISTVIEW             "SysListView"
  2551. #endif
  2552.  
  2553. // begin_r_commctrl
  2554.  
  2555. #define LVS_ICON                0x0000
  2556. #define LVS_REPORT              0x0001
  2557. #define LVS_SMALLICON           0x0002
  2558. #define LVS_LIST                0x0003
  2559. #define LVS_TYPEMASK            0x0003
  2560. #define LVS_SINGLESEL           0x0004
  2561. #define LVS_SHOWSELALWAYS       0x0008
  2562. #define LVS_SORTASCENDING       0x0010
  2563. #define LVS_SORTDESCENDING      0x0020
  2564. #define LVS_SHAREIMAGELISTS     0x0040
  2565. #define LVS_NOLABELWRAP         0x0080
  2566. #define LVS_AUTOARRANGE         0x0100
  2567. #define LVS_EDITLABELS          0x0200
  2568. #if (_WIN32_IE >= 0x0300)
  2569. #define LVS_OWNERDATA           0x1000
  2570. #endif
  2571. #define LVS_NOSCROLL            0x2000
  2572.  
  2573. #define LVS_TYPESTYLEMASK       0xfc00
  2574.  
  2575. #define LVS_ALIGNTOP            0x0000
  2576. #define LVS_ALIGNLEFT           0x0800
  2577. #define LVS_ALIGNMASK           0x0c00
  2578.  
  2579. #define LVS_OWNERDRAWFIXED      0x0400
  2580. #define LVS_NOCOLUMNHEADER      0x4000
  2581. #define LVS_NOSORTHEADER        0x8000
  2582.  
  2583. // end_r_commctrl
  2584.  
  2585. #if (_WIN32_IE >= 0x0400)
  2586. #define LVM_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  2587. #define ListView_SetUnicodeFormat(hwnd, fUnicode)  \
  2588.     (BOOL)SNDMSG((hwnd), LVM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  2589.  
  2590. #define LVM_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  2591. #define ListView_GetUnicodeFormat(hwnd)  \
  2592.     (BOOL)SNDMSG((hwnd), LVM_GETUNICODEFORMAT, 0, 0)
  2593. #endif
  2594.  
  2595. #define LVM_GETBKCOLOR          (LVM_FIRST + 0)
  2596. #define ListView_GetBkColor(hwnd)  \
  2597.     (COLORREF)SNDMSG((hwnd), LVM_GETBKCOLOR, 0, 0L)
  2598.  
  2599. #define LVM_SETBKCOLOR          (LVM_FIRST + 1)
  2600. #define ListView_SetBkColor(hwnd, clrBk) \
  2601.     (BOOL)SNDMSG((hwnd), LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk))
  2602.  
  2603. #define LVM_GETIMAGELIST        (LVM_FIRST + 2)
  2604. #define ListView_GetImageList(hwnd, iImageList) \
  2605.     (HIMAGELIST)SNDMSG((hwnd), LVM_GETIMAGELIST, (WPARAM)(INT)(iImageList), 0L)
  2606.  
  2607. #define LVSIL_NORMAL            0
  2608. #define LVSIL_SMALL             1
  2609. #define LVSIL_STATE             2
  2610.  
  2611. #define LVM_SETIMAGELIST        (LVM_FIRST + 3)
  2612. #define ListView_SetImageList(hwnd, himl, iImageList) \
  2613.     (HIMAGELIST)(UINT)SNDMSG((hwnd), LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(UINT)(HIMAGELIST)(himl))
  2614.  
  2615. #define LVM_GETITEMCOUNT        (LVM_FIRST + 4)
  2616. #define ListView_GetItemCount(hwnd) \
  2617.     (int)SNDMSG((hwnd), LVM_GETITEMCOUNT, 0, 0L)
  2618.  
  2619.  
  2620. #define LVIF_TEXT               0x0001
  2621. #define LVIF_IMAGE              0x0002
  2622. #define LVIF_PARAM              0x0004
  2623. #define LVIF_STATE              0x0008
  2624. #if (_WIN32_IE >= 0x0300)
  2625. #define LVIF_INDENT             0x0010
  2626. #define LVIF_NORECOMPUTE        0x0800
  2627. #endif
  2628.  
  2629. #define LVIS_FOCUSED            0x0001
  2630. #define LVIS_SELECTED           0x0002
  2631. #define LVIS_CUT                0x0004
  2632. #define LVIS_DROPHILITED        0x0008
  2633. #define LVIS_ACTIVATING         0x0020
  2634.  
  2635. #define LVIS_OVERLAYMASK        0x0F00
  2636. #define LVIS_STATEIMAGEMASK     0xF000
  2637.  
  2638. #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12)
  2639.  
  2640. #if (_WIN32_IE >= 0x0300)
  2641. #define I_INDENTCALLBACK        (-1)
  2642. #define LV_ITEMA LVITEMA
  2643. #define LV_ITEMW LVITEMW
  2644. #else
  2645. #define tagLVITEMA    _LV_ITEMA
  2646. #define LVITEMA       LV_ITEMA
  2647. #define tagLVITEMW    _LV_ITEMW
  2648. #define LVITEMW       LV_ITEMW
  2649. #endif
  2650.  
  2651. #define LV_ITEM LVITEM
  2652.  
  2653. #define LVITEMA_V1_SIZE CCSIZEOF_STRUCT(LVITEMA, lParam)
  2654. #define LVITEMW_V1_SIZE CCSIZEOF_STRUCT(LVITEMW, lParam)
  2655.  
  2656. typedef struct tagLVITEMA
  2657. {
  2658.     UINT mask;
  2659.     int iItem;
  2660.     int iSubItem;
  2661.     UINT state;
  2662.     UINT stateMask;
  2663.     LPSTR pszText;
  2664.     int cchTextMax;
  2665.     int iImage;
  2666.     LPARAM lParam;
  2667. #if (_WIN32_IE >= 0x0300)
  2668.     int iIndent;
  2669. #endif
  2670. } LVITEMA, FAR* LPLVITEMA;
  2671.  
  2672. typedef struct tagLVITEMW
  2673. {
  2674.     UINT mask;
  2675.     int iItem;
  2676.     int iSubItem;
  2677.     UINT state;
  2678.     UINT stateMask;
  2679.     LPWSTR pszText;
  2680.     int cchTextMax;
  2681.     int iImage;
  2682.     LPARAM lParam;
  2683. #if (_WIN32_IE >= 0x0300)
  2684.     int iIndent;
  2685. #endif
  2686. } LVITEMW, FAR* LPLVITEMW;
  2687.  
  2688.  
  2689. #ifdef UNICODE
  2690. #define LVITEM    LVITEMW
  2691. #define LPLVITEM  LPLVITEMW
  2692. #define LVITEM_V1_SIZE LVITEMW_V1_SIZE
  2693. #else
  2694. #define LVITEM    LVITEMA
  2695. #define LPLVITEM  LPLVITEMA
  2696. #define LVITEM_V1_SIZE LVITEMA_V1_SIZE
  2697. #endif
  2698.  
  2699.  
  2700. #define LPSTR_TEXTCALLBACKW     ((LPWSTR)-1L)
  2701. #define LPSTR_TEXTCALLBACKA     ((LPSTR)-1L)
  2702. #ifdef UNICODE
  2703. #define LPSTR_TEXTCALLBACK      LPSTR_TEXTCALLBACKW
  2704. #else
  2705. #define LPSTR_TEXTCALLBACK      LPSTR_TEXTCALLBACKA
  2706. #endif
  2707.  
  2708. #define I_IMAGECALLBACK         (-1)
  2709.  
  2710. #define LVM_GETITEMA            (LVM_FIRST + 5)
  2711. #define LVM_GETITEMW            (LVM_FIRST + 75)
  2712. #ifdef UNICODE
  2713. #define LVM_GETITEM             LVM_GETITEMW
  2714. #else
  2715. #define LVM_GETITEM             LVM_GETITEMA
  2716. #endif
  2717.  
  2718. #define ListView_GetItem(hwnd, pitem) \
  2719.     (BOOL)SNDMSG((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM FAR*)(pitem))
  2720.  
  2721.  
  2722. #define LVM_SETITEMA            (LVM_FIRST + 6)
  2723. #define LVM_SETITEMW            (LVM_FIRST + 76)
  2724. #ifdef UNICODE
  2725. #define LVM_SETITEM             LVM_SETITEMW
  2726. #else
  2727. #define LVM_SETITEM             LVM_SETITEMA
  2728. #endif
  2729.  
  2730. #define ListView_SetItem(hwnd, pitem) \
  2731.     (BOOL)SNDMSG((hwnd), LVM_SETITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  2732.  
  2733.  
  2734. #define LVM_INSERTITEMA         (LVM_FIRST + 7)
  2735. #define LVM_INSERTITEMW         (LVM_FIRST + 77)
  2736. #ifdef UNICODE
  2737. #define LVM_INSERTITEM          LVM_INSERTITEMW
  2738. #else
  2739. #define LVM_INSERTITEM          LVM_INSERTITEMA
  2740. #endif
  2741. #define ListView_InsertItem(hwnd, pitem)   \
  2742.     (int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  2743.  
  2744.  
  2745. #define LVM_DELETEITEM          (LVM_FIRST + 8)
  2746. #define ListView_DeleteItem(hwnd, i) \
  2747.     (BOOL)SNDMSG((hwnd), LVM_DELETEITEM, (WPARAM)(int)(i), 0L)
  2748.  
  2749.  
  2750. #define LVM_DELETEALLITEMS      (LVM_FIRST + 9)
  2751. #define ListView_DeleteAllItems(hwnd) \
  2752.     (BOOL)SNDMSG((hwnd), LVM_DELETEALLITEMS, 0, 0L)
  2753.  
  2754.  
  2755. #define LVM_GETCALLBACKMASK     (LVM_FIRST + 10)
  2756. #define ListView_GetCallbackMask(hwnd) \
  2757.     (BOOL)SNDMSG((hwnd), LVM_GETCALLBACKMASK, 0, 0)
  2758.  
  2759.  
  2760. #define LVM_SETCALLBACKMASK     (LVM_FIRST + 11)
  2761. #define ListView_SetCallbackMask(hwnd, mask) \
  2762.     (BOOL)SNDMSG((hwnd), LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0)
  2763.  
  2764.  
  2765. #define LVNI_ALL                0x0000
  2766. #define LVNI_FOCUSED            0x0001
  2767. #define LVNI_SELECTED           0x0002
  2768. #define LVNI_CUT                0x0004
  2769. #define LVNI_DROPHILITED        0x0008
  2770.  
  2771. #define LVNI_ABOVE              0x0100
  2772. #define LVNI_BELOW              0x0200
  2773. #define LVNI_TOLEFT             0x0400
  2774. #define LVNI_TORIGHT            0x0800
  2775.  
  2776.  
  2777. #define LVM_GETNEXTITEM         (LVM_FIRST + 12)
  2778. #define ListView_GetNextItem(hwnd, i, flags) \
  2779.     (int)SNDMSG((hwnd), LVM_GETNEXTITEM, (WPARAM)(int)(i), MAKELPARAM((flags), 0))
  2780.  
  2781.  
  2782. #define LVFI_PARAM              0x0001
  2783. #define LVFI_STRING             0x0002
  2784. #define LVFI_PARTIAL            0x0008
  2785. #define LVFI_WRAP               0x0020
  2786. #define LVFI_NEARESTXY          0x0040
  2787.  
  2788. #if (_WIN32_IE >= 0x0300)
  2789. #define LV_FINDINFOA    LVFINDINFOA
  2790. #define LV_FINDINFOW    LVFINDINFOW
  2791. #else
  2792. #define tagLVFINDINFOA  _LV_FINDINFOA
  2793. #define    LVFINDINFOA   LV_FINDINFOA
  2794. #define tagLVFINDINFOW  _LV_FINDINFOW
  2795. #define    LVFINDINFOW   LV_FINDINFOW
  2796. #endif
  2797.  
  2798. #define LV_FINDINFO  LVFINDINFO
  2799.  
  2800. typedef struct tagLVFINDINFOA
  2801. {
  2802.     UINT flags;
  2803.     LPCSTR psz;
  2804.     LPARAM lParam;
  2805.     POINT pt;
  2806.     UINT vkDirection;
  2807. } LVFINDINFOA, FAR* LPFINDINFOA;
  2808.  
  2809. typedef struct tagLVFINDINFOW
  2810. {
  2811.     UINT flags;
  2812.     LPCWSTR psz;
  2813.     LPARAM lParam;
  2814.     POINT pt;
  2815.     UINT vkDirection;
  2816. } LVFINDINFOW, FAR* LPFINDINFOW;
  2817.  
  2818. #ifdef UNICODE
  2819. #define  LVFINDINFO            LVFINDINFOW
  2820. #else
  2821. #define  LVFINDINFO            LVFINDINFOA
  2822. #endif
  2823.  
  2824. #define LVM_FINDITEMA           (LVM_FIRST + 13)
  2825. #define LVM_FINDITEMW           (LVM_FIRST + 83)
  2826. #ifdef UNICODE
  2827. #define  LVM_FINDITEM           LVM_FINDITEMW
  2828. #else
  2829. #define  LVM_FINDITEM           LVM_FINDITEMA
  2830. #endif
  2831.  
  2832. #define ListView_FindItem(hwnd, iStart, plvfi) \
  2833.     (int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
  2834.  
  2835. #define LVIR_BOUNDS             0
  2836. #define LVIR_ICON               1
  2837. #define LVIR_LABEL              2
  2838. #define LVIR_SELECTBOUNDS       3
  2839.  
  2840.  
  2841. #define LVM_GETITEMRECT         (LVM_FIRST + 14)
  2842. #define ListView_GetItemRect(hwnd, i, prc, code) \
  2843.      (BOOL)SNDMSG((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \
  2844.            ((prc) ? (((RECT FAR *)(prc))->left = (code),(LPARAM)(RECT FAR*)(prc)) : (LPARAM)(RECT FAR*)NULL))
  2845.  
  2846.  
  2847. #define LVM_SETITEMPOSITION     (LVM_FIRST + 15)
  2848. #define ListView_SetItemPosition(hwndLV, i, x, y) \
  2849.     (BOOL)SNDMSG((hwndLV), LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y)))
  2850.  
  2851.  
  2852. #define LVM_GETITEMPOSITION     (LVM_FIRST + 16)
  2853. #define ListView_GetItemPosition(hwndLV, i, ppt) \
  2854.     (BOOL)SNDMSG((hwndLV), LVM_GETITEMPOSITION, (WPARAM)(int)(i), (LPARAM)(POINT FAR*)(ppt))
  2855.  
  2856.  
  2857. #define LVM_GETSTRINGWIDTHA     (LVM_FIRST + 17)
  2858. #define LVM_GETSTRINGWIDTHW     (LVM_FIRST + 87)
  2859. #ifdef UNICODE
  2860. #define  LVM_GETSTRINGWIDTH     LVM_GETSTRINGWIDTHW
  2861. #else
  2862. #define  LVM_GETSTRINGWIDTH     LVM_GETSTRINGWIDTHA
  2863. #endif
  2864.  
  2865. #define ListView_GetStringWidth(hwndLV, psz) \
  2866.     (int)SNDMSG((hwndLV), LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)(psz))
  2867.  
  2868.  
  2869. #define LVHT_NOWHERE            0x0001
  2870. #define LVHT_ONITEMICON         0x0002
  2871. #define LVHT_ONITEMLABEL        0x0004
  2872. #define LVHT_ONITEMSTATEICON    0x0008
  2873. #define LVHT_ONITEM             (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
  2874.  
  2875. #define LVHT_ABOVE              0x0008
  2876. #define LVHT_BELOW              0x0010
  2877. #define LVHT_TORIGHT            0x0020
  2878. #define LVHT_TOLEFT             0x0040
  2879.  
  2880. #if (_WIN32_IE >= 0x0300)
  2881. #define LV_HITTESTINFO LVHITTESTINFO
  2882. #else
  2883. #define tagLVHITTESTINFO  _LV_HITTESTINFO
  2884. #define    LVHITTESTINFO   LV_HITTESTINFO
  2885. #endif
  2886.  
  2887. #define LVHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(LVHITTESTINFO, iItem)
  2888.  
  2889. typedef struct tagLVHITTESTINFO
  2890. {
  2891.     POINT pt;
  2892.     UINT flags;
  2893.     int iItem;
  2894. #if (_WIN32_IE >= 0x0300)
  2895.     int iSubItem;    // this is was NOT in win95.  valid only for LVM_SUBITEMHITTEST
  2896. #endif
  2897. } LVHITTESTINFO, FAR* LPLVHITTESTINFO;
  2898.  
  2899. #define LVM_HITTEST             (LVM_FIRST + 18)
  2900. #define ListView_HitTest(hwndLV, pinfo) \
  2901.     (int)SNDMSG((hwndLV), LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO FAR*)(pinfo))
  2902.  
  2903.  
  2904. #define LVM_ENSUREVISIBLE       (LVM_FIRST + 19)
  2905. #define ListView_EnsureVisible(hwndLV, i, fPartialOK) \
  2906.     (BOOL)SNDMSG((hwndLV), LVM_ENSUREVISIBLE, (WPARAM)(int)(i), MAKELPARAM((fPartialOK), 0))
  2907.  
  2908.  
  2909. #define LVM_SCROLL              (LVM_FIRST + 20)
  2910. #define ListView_Scroll(hwndLV, dx, dy) \
  2911.     (BOOL)SNDMSG((hwndLV), LVM_SCROLL, (WPARAM)(int)dx, (LPARAM)(int)dy)
  2912.  
  2913.  
  2914. #define LVM_REDRAWITEMS         (LVM_FIRST + 21)
  2915. #define ListView_RedrawItems(hwndLV, iFirst, iLast) \
  2916.     (BOOL)SNDMSG((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)iFirst, (LPARAM)(int)iLast)
  2917.  
  2918.  
  2919. #define LVA_DEFAULT             0x0000
  2920. #define LVA_ALIGNLEFT           0x0001
  2921. #define LVA_ALIGNTOP            0x0002
  2922. #define LVA_SNAPTOGRID          0x0005
  2923.  
  2924. #define LVM_ARRANGE             (LVM_FIRST + 22)
  2925. #define ListView_Arrange(hwndLV, code) \
  2926.     (BOOL)SNDMSG((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0L)
  2927.  
  2928.  
  2929. #define LVM_EDITLABELA          (LVM_FIRST + 23)
  2930. #define LVM_EDITLABELW          (LVM_FIRST + 118)
  2931. #ifdef UNICODE
  2932. #define LVM_EDITLABEL           LVM_EDITLABELW
  2933. #else
  2934. #define LVM_EDITLABEL           LVM_EDITLABELA
  2935. #endif
  2936.  
  2937. #define ListView_EditLabel(hwndLV, i) \
  2938.     (HWND)SNDMSG((hwndLV), LVM_EDITLABEL, (WPARAM)(int)(i), 0L)
  2939.  
  2940.  
  2941. #define LVM_GETEDITCONTROL      (LVM_FIRST + 24)
  2942. #define ListView_GetEditControl(hwndLV) \
  2943.     (HWND)SNDMSG((hwndLV), LVM_GETEDITCONTROL, 0, 0L)
  2944.  
  2945.  
  2946. #if (_WIN32_IE >= 0x0300)
  2947. #define LV_COLUMNA      LVCOLUMNA
  2948. #define LV_COLUMNW      LVCOLUMNW
  2949. #else
  2950. #define tagLVCOLUMNA    _LV_COLUMNA
  2951. #define    LVCOLUMNA     LV_COLUMNA
  2952. #define tagLVCOLUMNW    _LV_COLUMNW
  2953. #define    LVCOLUMNW     LV_COLUMNW
  2954. #endif
  2955.  
  2956. #define LV_COLUMN       LVCOLUMN
  2957.  
  2958. #define LVCOLUMNA_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNA, iSubItem)
  2959. #define LVCOLUMNW_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNW, iSubItem)
  2960.  
  2961. typedef struct tagLVCOLUMNA
  2962. {
  2963.     UINT mask;
  2964.     int fmt;
  2965.     int cx;
  2966.     LPSTR pszText;
  2967.     int cchTextMax;
  2968.     int iSubItem;
  2969. #if (_WIN32_IE >= 0x0300)
  2970.     int iImage;
  2971.     int iOrder;
  2972. #endif
  2973. } LVCOLUMNA, FAR* LPLVCOLUMNA;
  2974.  
  2975. typedef struct tagLVCOLUMNW
  2976. {
  2977.     UINT mask;
  2978.     int fmt;
  2979.     int cx;
  2980.     LPWSTR pszText;
  2981.     int cchTextMax;
  2982.     int iSubItem;
  2983. #if (_WIN32_IE >= 0x0300)
  2984.     int iImage;
  2985.     int iOrder;
  2986. #endif
  2987. } LVCOLUMNW, FAR* LPLVCOLUMNW;
  2988.  
  2989. #ifdef UNICODE
  2990. #define  LVCOLUMN               LVCOLUMNW
  2991. #define  LPLVCOLUMN             LPLVCOLUMNW
  2992. #define LVCOLUMN_V1_SIZE LVCOLUMNW_V1_SIZE
  2993. #else
  2994. #define  LVCOLUMN               LVCOLUMNA
  2995. #define  LPLVCOLUMN             LPLVCOLUMNA
  2996. #define LVCOLUMN_V1_SIZE LVCOLUMNA_V1_SIZE
  2997. #endif
  2998.  
  2999.  
  3000. #define LVCF_FMT                0x0001
  3001. #define LVCF_WIDTH              0x0002
  3002. #define LVCF_TEXT               0x0004
  3003. #define LVCF_SUBITEM            0x0008
  3004. #if (_WIN32_IE >= 0x0300)
  3005. #define LVCF_IMAGE              0x0010
  3006. #define LVCF_ORDER              0x0020
  3007. #endif
  3008.  
  3009. #define LVCFMT_LEFT             0x0000
  3010. #define LVCFMT_RIGHT            0x0001
  3011. #define LVCFMT_CENTER           0x0002
  3012. #define LVCFMT_JUSTIFYMASK      0x0003
  3013. #if (_WIN32_IE >= 0x0300)
  3014. #define LVCFMT_IMAGE            0x0800
  3015. #define LVCFMT_BITMAP_ON_RIGHT  0x1000
  3016. #define LVCFMT_COL_HAS_IMAGES   0x8000
  3017. #endif
  3018.  
  3019. #define LVM_GETCOLUMNA          (LVM_FIRST + 25)
  3020. #define LVM_GETCOLUMNW          (LVM_FIRST + 95)
  3021. #ifdef UNICODE
  3022. #define  LVM_GETCOLUMN          LVM_GETCOLUMNW
  3023. #else
  3024. #define  LVM_GETCOLUMN          LVM_GETCOLUMNA
  3025. #endif
  3026.  
  3027. #define ListView_GetColumn(hwnd, iCol, pcol) \
  3028.     (BOOL)SNDMSG((hwnd), LVM_GETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(LV_COLUMN FAR*)(pcol))
  3029.  
  3030.  
  3031. #define LVM_SETCOLUMNA          (LVM_FIRST + 26)
  3032. #define LVM_SETCOLUMNW          (LVM_FIRST + 96)
  3033. #ifdef UNICODE
  3034. #define  LVM_SETCOLUMN          LVM_SETCOLUMNW
  3035. #else
  3036. #define  LVM_SETCOLUMN          LVM_SETCOLUMNA
  3037. #endif
  3038.  
  3039. #define ListView_SetColumn(hwnd, iCol, pcol) \
  3040.     (BOOL)SNDMSG((hwnd), LVM_SETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  3041.  
  3042.  
  3043. #define LVM_INSERTCOLUMNA       (LVM_FIRST + 27)
  3044. #define LVM_INSERTCOLUMNW       (LVM_FIRST + 97)
  3045. #ifdef UNICODE
  3046. #   define  LVM_INSERTCOLUMN    LVM_INSERTCOLUMNW
  3047. #else
  3048. #   define  LVM_INSERTCOLUMN    LVM_INSERTCOLUMNA
  3049. #endif
  3050.  
  3051. #define ListView_InsertColumn(hwnd, iCol, pcol) \
  3052.     (int)SNDMSG((hwnd), LVM_INSERTCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  3053.  
  3054.  
  3055. #define LVM_DELETECOLUMN        (LVM_FIRST + 28)
  3056. #define ListView_DeleteColumn(hwnd, iCol) \
  3057.     (BOOL)SNDMSG((hwnd), LVM_DELETECOLUMN, (WPARAM)(int)(iCol), 0)
  3058.  
  3059.  
  3060. #define LVM_GETCOLUMNWIDTH      (LVM_FIRST + 29)
  3061. #define ListView_GetColumnWidth(hwnd, iCol) \
  3062.     (int)SNDMSG((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0)
  3063.  
  3064.  
  3065. #define LVSCW_AUTOSIZE              -1
  3066. #define LVSCW_AUTOSIZE_USEHEADER    -2
  3067. #define LVM_SETCOLUMNWIDTH          (LVM_FIRST + 30)
  3068.  
  3069. #define ListView_SetColumnWidth(hwnd, iCol, cx) \
  3070.     (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0))
  3071.  
  3072. #if (_WIN32_IE >= 0x0300)
  3073. #define LVM_GETHEADER               (LVM_FIRST + 31)
  3074. #define ListView_GetHeader(hwnd)\
  3075.     (HWND)SNDMSG((hwnd), LVM_GETHEADER, 0, 0L)
  3076. #endif
  3077.  
  3078. #define LVM_CREATEDRAGIMAGE     (LVM_FIRST + 33)
  3079. #define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \
  3080.     (HIMAGELIST)SNDMSG((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft))
  3081.  
  3082.  
  3083. #define LVM_GETVIEWRECT         (LVM_FIRST + 34)
  3084. #define ListView_GetViewRect(hwnd, prc) \
  3085.     (BOOL)SNDMSG((hwnd), LVM_GETVIEWRECT, 0, (LPARAM)(RECT FAR*)(prc))
  3086.  
  3087.  
  3088. #define LVM_GETTEXTCOLOR        (LVM_FIRST + 35)
  3089. #define ListView_GetTextColor(hwnd)  \
  3090.     (COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0L)
  3091.  
  3092.  
  3093. #define LVM_SETTEXTCOLOR        (LVM_FIRST + 36)
  3094. #define ListView_SetTextColor(hwnd, clrText) \
  3095.     (BOOL)SNDMSG((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText))
  3096.  
  3097.  
  3098. #define LVM_GETTEXTBKCOLOR      (LVM_FIRST + 37)
  3099. #define ListView_GetTextBkColor(hwnd)  \
  3100.     (COLORREF)SNDMSG((hwnd), LVM_GETTEXTBKCOLOR, 0, 0L)
  3101.  
  3102.  
  3103. #define LVM_SETTEXTBKCOLOR      (LVM_FIRST + 38)
  3104. #define ListView_SetTextBkColor(hwnd, clrTextBk) \
  3105.     (BOOL)SNDMSG((hwnd), LVM_SETTEXTBKCOLOR, 0, (LPARAM)(COLORREF)(clrTextBk))
  3106.  
  3107.  
  3108. #define LVM_GETTOPINDEX         (LVM_FIRST + 39)
  3109. #define ListView_GetTopIndex(hwndLV) \
  3110.     (int)SNDMSG((hwndLV), LVM_GETTOPINDEX, 0, 0)
  3111.  
  3112.  
  3113. #define LVM_GETCOUNTPERPAGE     (LVM_FIRST + 40)
  3114. #define ListView_GetCountPerPage(hwndLV) \
  3115.     (int)SNDMSG((hwndLV), LVM_GETCOUNTPERPAGE, 0, 0)
  3116.  
  3117.  
  3118. #define LVM_GETORIGIN           (LVM_FIRST + 41)
  3119. #define ListView_GetOrigin(hwndLV, ppt) \
  3120.     (BOOL)SNDMSG((hwndLV), LVM_GETORIGIN, (WPARAM)0, (LPARAM)(POINT FAR*)(ppt))
  3121.  
  3122.  
  3123. #define LVM_UPDATE              (LVM_FIRST + 42)
  3124. #define ListView_Update(hwndLV, i) \
  3125.     (BOOL)SNDMSG((hwndLV), LVM_UPDATE, (WPARAM)i, 0L)
  3126.  
  3127.  
  3128. #define LVM_SETITEMSTATE        (LVM_FIRST + 43)
  3129. #define ListView_SetItemState(hwndLV, i, data, mask) \
  3130. { LV_ITEM _ms_lvi;\
  3131.   _ms_lvi.stateMask = mask;\
  3132.   _ms_lvi.state = data;\
  3133.   SNDMSG((hwndLV), LVM_SETITEMSTATE, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  3134. }
  3135.  
  3136.  
  3137. #define LVM_GETITEMSTATE        (LVM_FIRST + 44)
  3138. #define ListView_GetItemState(hwndLV, i, mask) \
  3139.    (UINT)SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, (LPARAM)mask)
  3140.  
  3141. #if (_WIN32_IE >= 0x0300)
  3142. #define ListView_GetCheckState(hwndLV, i) \
  3143.    ((((UINT)(SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, LVIS_STATEIMAGEMASK))) >> 12) -1)
  3144. #endif
  3145.  
  3146. #define LVM_GETITEMTEXTA        (LVM_FIRST + 45)
  3147. #define LVM_GETITEMTEXTW        (LVM_FIRST + 115)
  3148.  
  3149. #ifdef UNICODE
  3150. #define  LVM_GETITEMTEXT        LVM_GETITEMTEXTW
  3151. #else
  3152. #define  LVM_GETITEMTEXT        LVM_GETITEMTEXTA
  3153. #endif
  3154.  
  3155. #define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
  3156. { LV_ITEM _ms_lvi;\
  3157.   _ms_lvi.iSubItem = iSubItem_;\
  3158.   _ms_lvi.cchTextMax = cchTextMax_;\
  3159.   _ms_lvi.pszText = pszText_;\
  3160.   SNDMSG((hwndLV), LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  3161. }
  3162.  
  3163.  
  3164. #define LVM_SETITEMTEXTA        (LVM_FIRST + 46)
  3165. #define LVM_SETITEMTEXTW        (LVM_FIRST + 116)
  3166.  
  3167. #ifdef UNICODE
  3168. #define  LVM_SETITEMTEXT        LVM_SETITEMTEXTW
  3169. #else
  3170. #define  LVM_SETITEMTEXT        LVM_SETITEMTEXTA
  3171. #endif
  3172.  
  3173. #define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) \
  3174. { LV_ITEM _ms_lvi;\
  3175.   _ms_lvi.iSubItem = iSubItem_;\
  3176.   _ms_lvi.pszText = pszText_;\
  3177.   SNDMSG((hwndLV), LVM_SETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  3178. }
  3179.  
  3180. #if (_WIN32_IE >= 0x0300)
  3181. // these flags only apply to LVS_OWNERDATA listviews in report or list mode
  3182. #define LVSICF_NOINVALIDATEALL  0x00000001
  3183. #define LVSICF_NOSCROLL         0x00000002
  3184. #endif
  3185.  
  3186. #define LVM_SETITEMCOUNT        (LVM_FIRST + 47)
  3187. #define ListView_SetItemCount(hwndLV, cItems) \
  3188.   SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, 0)
  3189.  
  3190. #if (_WIN32_IE >= 0x0300)
  3191. #define ListView_SetItemCountEx(hwndLV, cItems, dwFlags) \
  3192.   SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, (LPARAM)dwFlags)
  3193. #endif
  3194.  
  3195. typedef int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
  3196.  
  3197.  
  3198. #define LVM_SORTITEMS           (LVM_FIRST + 48)
  3199. #define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) \
  3200.   (BOOL)SNDMSG((hwndLV), LVM_SORTITEMS, (WPARAM)(LPARAM)_lPrm, \
  3201.   (LPARAM)(PFNLVCOMPARE)_pfnCompare)
  3202.  
  3203.  
  3204. #define LVM_SETITEMPOSITION32   (LVM_FIRST + 49)
  3205. #define ListView_SetItemPosition32(hwndLV, i, x, y) \
  3206. { POINT ptNewPos = {x,y}; \
  3207.     SNDMSG((hwndLV), LVM_SETITEMPOSITION32, (WPARAM)(int)(i), (LPARAM)&ptNewPos); \
  3208. }
  3209.  
  3210.  
  3211. #define LVM_GETSELECTEDCOUNT    (LVM_FIRST + 50)
  3212. #define ListView_GetSelectedCount(hwndLV) \
  3213.     (UINT)SNDMSG((hwndLV), LVM_GETSELECTEDCOUNT, 0, 0L)
  3214.  
  3215.  
  3216. #define LVM_GETITEMSPACING      (LVM_FIRST + 51)
  3217. #define ListView_GetItemSpacing(hwndLV, fSmall) \
  3218.         (DWORD)SNDMSG((hwndLV), LVM_GETITEMSPACING, fSmall, 0L)
  3219.  
  3220.  
  3221. #define LVM_GETISEARCHSTRINGA   (LVM_FIRST + 52)
  3222. #define LVM_GETISEARCHSTRINGW   (LVM_FIRST + 117)
  3223.  
  3224. #ifdef UNICODE
  3225. #define LVM_GETISEARCHSTRING    LVM_GETISEARCHSTRINGW
  3226. #else
  3227. #define LVM_GETISEARCHSTRING    LVM_GETISEARCHSTRINGA
  3228. #endif
  3229.  
  3230. #define ListView_GetISearchString(hwndLV, lpsz) \
  3231.         (BOOL)SNDMSG((hwndLV), LVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
  3232.  
  3233. #if (_WIN32_IE >= 0x0300)
  3234. #define LVM_SETICONSPACING      (LVM_FIRST + 53)
  3235. // -1 for cx and cy means we'll use the default (system settings)
  3236. // 0 for cx or cy means use the current setting (allows you to change just one param)
  3237. #define ListView_SetIconSpacing(hwndLV, cx, cy) \
  3238.         (DWORD)SNDMSG((hwndLV), LVM_SETICONSPACING, 0, MAKELONG(cx,cy))
  3239.  
  3240.  
  3241. #define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 54)   // optional wParam == mask
  3242. #define ListView_SetExtendedListViewStyle(hwndLV, dw)\
  3243.         (DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw)
  3244. #if (_WIN32_IE >= 0x0400)
  3245. #define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)\
  3246.         (DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, dwMask, dw)
  3247. #endif
  3248.  
  3249. #define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 55)
  3250. #define ListView_GetExtendedListViewStyle(hwndLV)\
  3251.         (DWORD)SNDMSG((hwndLV), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
  3252.  
  3253. #define LVS_EX_GRIDLINES        0x00000001
  3254. #define LVS_EX_SUBITEMIMAGES    0x00000002
  3255. #define LVS_EX_CHECKBOXES       0x00000004
  3256. #define LVS_EX_TRACKSELECT      0x00000008
  3257. #define LVS_EX_HEADERDRAGDROP   0x00000010
  3258. #define LVS_EX_FULLROWSELECT    0x00000020 // applies to report mode only
  3259. #define LVS_EX_ONECLICKACTIVATE 0x00000040
  3260. #define LVS_EX_TWOCLICKACTIVATE 0x00000080
  3261. #if (_WIN32_IE >= 0x0400)
  3262. #define LVS_EX_FLATSB           0x00000100
  3263. #define LVS_EX_REGIONAL         0x00000200
  3264. #define LVS_EX_INFOTIP          0x00000400 // listview does InfoTips for you
  3265. #define LVS_EX_UNDERLINEHOT     0x00000800
  3266. #define LVS_EX_UNDERLINECOLD    0x00001000
  3267. #define LVS_EX_MULTIWORKAREAS   0x00002000
  3268. #endif
  3269.  
  3270. #define LVM_GETSUBITEMRECT      (LVM_FIRST + 56)
  3271. #define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
  3272.         (BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
  3273.                 ((prc) ? ((((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))
  3274.  
  3275. #define LVM_SUBITEMHITTEST      (LVM_FIRST + 57)
  3276. #define ListView_SubItemHitTest(hwnd, plvhti) \
  3277.         (int)SNDMSG((hwnd), LVM_SUBITEMHITTEST, 0, (LPARAM)(LPLVHITTESTINFO)(plvhti))
  3278.  
  3279. #define LVM_SETCOLUMNORDERARRAY (LVM_FIRST + 58)
  3280. #define ListView_SetColumnOrderArray(hwnd, iCount, pi) \
  3281.         (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
  3282.  
  3283. #define LVM_GETCOLUMNORDERARRAY (LVM_FIRST + 59)
  3284. #define ListView_GetColumnOrderArray(hwnd, iCount, pi) \
  3285.         (BOOL)SNDMSG((hwnd), LVM_GETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
  3286.  
  3287. #define LVM_SETHOTITEM  (LVM_FIRST + 60)
  3288. #define ListView_SetHotItem(hwnd, i) \
  3289.         (int)SNDMSG((hwnd), LVM_SETHOTITEM, (WPARAM)i, 0)
  3290.  
  3291. #define LVM_GETHOTITEM  (LVM_FIRST + 61)
  3292. #define ListView_GetHotItem(hwnd) \
  3293.         (int)SNDMSG((hwnd), LVM_GETHOTITEM, 0, 0)
  3294.  
  3295. #define LVM_SETHOTCURSOR  (LVM_FIRST + 62)
  3296. #define ListView_SetHotCursor(hwnd, hcur) \
  3297.         (HCURSOR)SNDMSG((hwnd), LVM_SETHOTCURSOR, 0, (LPARAM)hcur)
  3298.  
  3299. #define LVM_GETHOTCURSOR  (LVM_FIRST + 63)
  3300. #define ListView_GetHotCursor(hwnd) \
  3301.         (HCURSOR)SNDMSG((hwnd), LVM_GETHOTCURSOR, 0, 0)
  3302.  
  3303. #define LVM_APPROXIMATEVIEWRECT (LVM_FIRST + 64)
  3304. #define ListView_ApproximateViewRect(hwnd, iWidth, iHeight, iCount) \
  3305.         (DWORD)SNDMSG((hwnd), LVM_APPROXIMATEVIEWRECT, iCount, MAKELPARAM(iWidth, iHeight))
  3306. #endif      // _WIN32_IE >= 0x0300
  3307.  
  3308. #if (_WIN32_IE >= 0x0400)
  3309.  
  3310. #define LV_MAX_WORKAREAS         16                          
  3311. #define LVM_SETWORKAREAS         (LVM_FIRST + 65)
  3312. #define ListView_SetWorkAreas(hwnd, nWorkAreas, prc) \
  3313.     (BOOL)SNDMSG((hwnd), LVM_SETWORKAREAS, (WPARAM)(int)nWorkAreas, (LPARAM)(RECT FAR*)(prc))
  3314.  
  3315. #define LVM_GETWORKAREAS        (LVM_FIRST + 70)
  3316. #define ListView_GetWorkAreas(hwnd, nWorkAreas, prc) \
  3317.     (BOOL)SNDMSG((hwnd), LVM_GETWORKAREAS, (WPARAM)(int)nWorkAreas, (LPARAM)(RECT FAR*)(prc))
  3318.  
  3319.  
  3320. #define LVM_GETNUMBEROFWORKAREAS  (LVM_FIRST + 73)
  3321. #define ListView_GetNumberOfWorkAreas(hwnd, pnWorkAreas) \
  3322.     (BOOL)SNDMSG((hwnd), LVM_GETNUMBEROFWORKAREAS, 0, (LPARAM)(UINT *)(pnWorkAreas))
  3323.  
  3324.  
  3325. #define LVM_GETSELECTIONMARK    (LVM_FIRST + 66)
  3326. #define ListView_GetSelectionMark(hwnd) \
  3327.     (int)SNDMSG((hwnd), LVM_GETSELECTIONMARK, 0, 0)
  3328.  
  3329. #define LVM_SETSELECTIONMARK    (LVM_FIRST + 67)
  3330. #define ListView_SetSelectionMark(hwnd, i) \
  3331.     (int)SNDMSG((hwnd), LVM_SETSELECTIONMARK, 0, (LPARAM)i)
  3332.  
  3333. #define LVM_SETHOVERTIME        (LVM_FIRST + 71)
  3334. #define ListView_SetHoverTime(hwndLV, dwHoverTimeMs)\
  3335.         (DWORD)SendMessage((hwndLV), LVM_SETHOVERTIME, 0, dwHoverTimeMs)
  3336.  
  3337. #define LVM_GETHOVERTIME        (LVM_FIRST + 72)
  3338. #define ListView_GetHoverTime(hwndLV)\
  3339.         (DWORD)SendMessage((hwndLV), LVM_GETHOVERTIME, 0, 0)
  3340.  
  3341. #define LVM_SETTOOLTIPS       (LVM_FIRST + 74)
  3342. #define ListView_SetToolTips(hwndLV, hwndNewHwnd)\
  3343.         (HWND)SendMessage((hwndLV), LVM_SETTOOLTIPS, hwndNewHwnd, 0)
  3344.  
  3345. #define LVM_GETTOOLTIPS       (LVM_FIRST + 78)
  3346. #define ListView_GetToolTips(hwndLV)\
  3347.         (HWND)SendMessage((hwndLV), LVM_GETTOOLTIPS, 0, 0)
  3348.  
  3349.  
  3350. typedef struct tagLVBKIMAGEA
  3351. {
  3352.     ULONG ulFlags;              // LVBKIF_*
  3353.     HBITMAP hbm;
  3354.     LPSTR pszImage;
  3355.     UINT cchImageMax;
  3356.     int xOffsetPercent;
  3357.     int yOffsetPercent;
  3358. } LVBKIMAGEA, FAR *LPLVBKIMAGEA;
  3359. typedef struct tagLVBKIMAGEW
  3360. {
  3361.     ULONG ulFlags;              // LVBKIF_*
  3362.     HBITMAP hbm;
  3363.     LPWSTR pszImage;
  3364.     UINT cchImageMax;
  3365.     int xOffsetPercent;
  3366.     int yOffsetPercent;
  3367. } LVBKIMAGEW, FAR *LPLVBKIMAGEW;
  3368.  
  3369. #define LVBKIF_SOURCE_NONE      0x00000000
  3370. #define LVBKIF_SOURCE_HBITMAP   0x00000001
  3371. #define LVBKIF_SOURCE_URL       0x00000002
  3372. #define LVBKIF_SOURCE_MASK      0x00000003
  3373. #define LVBKIF_STYLE_NORMAL     0x00000000
  3374. #define LVBKIF_STYLE_TILE       0x00000010
  3375. #define LVBKIF_STYLE_MASK       0x00000010
  3376.  
  3377. #define LVM_SETBKIMAGEA         (LVM_FIRST + 68)
  3378. #define LVM_SETBKIMAGEW         (LVM_FIRST + 138)
  3379. #define LVM_GETBKIMAGEA         (LVM_FIRST + 69)
  3380. #define LVM_GETBKIMAGEW         (LVM_FIRST + 139)
  3381.  
  3382. #ifdef UNICODE
  3383. #define LVBKIMAGE               LVBKIMAGEW
  3384. #define LPLVBKIMAGE             LPLVBKIMAGEW
  3385. #define LVM_SETBKIMAGE          LVM_SETBKIMAGEW
  3386. #define LVM_GETBKIMAGE          LVM_GETBKIMAGEW
  3387. #else
  3388. #define LVBKIMAGE               LVBKIMAGEA
  3389. #define LPLVBKIMAGE             LPLVBKIMAGEA
  3390. #define LVM_SETBKIMAGE          LVM_SETBKIMAGEA
  3391. #define LVM_GETBKIMAGE          LVM_GETBKIMAGEA
  3392. #endif
  3393.  
  3394. #define ListView_SetBkImage(hwnd, plvbki) \
  3395.     (BOOL)SNDMSG((hwnd), LVM_SETBKIMAGE, 0, (LPARAM)plvbki)
  3396.  
  3397. #define ListView_GetBkImage(hwnd, plvbki) \
  3398.     (BOOL)SNDMSG((hwnd), LVM_GETBKIMAGE, 0, (LPARAM)plvbki)
  3399.  
  3400.  
  3401. #endif      // _WIN32_IE >= 0x0400
  3402.  
  3403. #if (_WIN32_IE >= 0x0300)
  3404. #define LPNM_LISTVIEW   LPNMLISTVIEW
  3405. #define NM_LISTVIEW     NMLISTVIEW
  3406. #else
  3407. #define tagNMLISTVIEW   _NM_LISTVIEW
  3408. #define    NMLISTVIEW    NM_LISTVIEW
  3409. #define  LPNMLISTVIEW  LPNM_LISTVIEW
  3410. #endif
  3411.  
  3412. typedef struct tagNMLISTVIEW
  3413. {
  3414.     NMHDR   hdr;
  3415.     int     iItem;
  3416.     int     iSubItem;
  3417.     UINT    uNewState;
  3418.     UINT    uOldState;
  3419.     UINT    uChanged;
  3420.     POINT   ptAction;
  3421.     LPARAM  lParam;
  3422. } NMLISTVIEW, FAR *LPNMLISTVIEW;
  3423.  
  3424.  
  3425. #if (_WIN32_IE >= 0x400)
  3426. // NMITEMACTIVATE is used instead of NMLISTVIEW in IE >= 0x400
  3427. // therefore all the fields are the same except for extra uKeyFlags
  3428. // they are used to store key flags at the time of the single click with
  3429. // delayed activation - because by the time the timer goes off a user may
  3430. // not hold the keys (shift, ctrl) any more
  3431. typedef struct tagNMITEMACTIVATE
  3432. {
  3433.     NMHDR   hdr;
  3434.     int     iItem;
  3435.     int     iSubItem;
  3436.     UINT    uNewState;
  3437.     UINT    uOldState;
  3438.     UINT    uChanged;
  3439.     POINT   ptAction;
  3440.     LPARAM  lParam;
  3441.     UINT    uKeyFlags;
  3442. } NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;
  3443.  
  3444. // key flags stored in uKeyFlags
  3445. #define LVKF_ALT       0x0001
  3446. #define LVKF_CONTROL   0x0002
  3447. #define LVKF_SHIFT     0x0004
  3448. #endif //(_WIN32_IE >= 0x0400)
  3449.  
  3450.  
  3451. #if (_WIN32_IE >= 0x0300)
  3452. #define NMLVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMLVCUSTOMDRW, clrTextBk)
  3453.  
  3454. typedef struct tagNMLVCUSTOMDRAW
  3455. {
  3456.     NMCUSTOMDRAW nmcd;
  3457.     COLORREF clrText;
  3458.     COLORREF clrTextBk;
  3459. #if (_WIN32_IE >= 0x0400)
  3460.     int iSubItem;
  3461. #endif
  3462. } NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
  3463.  
  3464. typedef struct tagNMLVCACHEHINT
  3465. {
  3466.     NMHDR   hdr;
  3467.     int     iFrom;
  3468.     int     iTo;
  3469. } NMLVCACHEHINT, FAR *LPNMLVCACHEHINT;
  3470.  
  3471. #define LPNM_CACHEHINT  LPNMLVCACHEHINT
  3472. #define PNM_CACHEHINT   LPNMLVCACHEHINT
  3473. #define NM_CACHEHINT    NMLVCACHEHINT
  3474.  
  3475. typedef struct tagNMLVFINDITEM
  3476. {
  3477.     NMHDR   hdr;
  3478.     int     iStart;
  3479.     LVFINDINFO lvfi;
  3480. } NMLVFINDITEM, FAR *LPNMLVFINDITEM;
  3481.  
  3482. #define PNM_FINDITEM    LPNMLVFINDITEM
  3483. #define LPNM_FINDITEM   LPNMLVFINDITEM
  3484. #define NM_FINDITEM     NMLVFINDITEM
  3485.  
  3486. typedef struct tagNMLVODSTATECHANGE
  3487. {
  3488.     NMHDR hdr;
  3489.     int iFrom;
  3490.     int iTo;
  3491.     UINT uNewState;
  3492.     UINT uOldState;
  3493. } NMLVODSTATECHANGE, FAR *LPNMLVODSTATECHANGE;
  3494.  
  3495. #define PNM_ODSTATECHANGE   LPNMLVODSTATECHANGE
  3496. #define LPNM_ODSTATECHANGE  LPNMLVODSTATECHANGE
  3497. #define NM_ODSTATECHANGE    NMLVODSTATECHANGE
  3498. #endif      // _WIN32_IE >= 0x0300
  3499.  
  3500.  
  3501. #define LVN_ITEMCHANGING        (LVN_FIRST-0)
  3502. #define LVN_ITEMCHANGED         (LVN_FIRST-1)
  3503. #define LVN_INSERTITEM          (LVN_FIRST-2)
  3504. #define LVN_DELETEITEM          (LVN_FIRST-3)
  3505. #define LVN_DELETEALLITEMS      (LVN_FIRST-4)
  3506. #define LVN_BEGINLABELEDITA     (LVN_FIRST-5)
  3507. #define LVN_BEGINLABELEDITW     (LVN_FIRST-75)
  3508. #define LVN_ENDLABELEDITA       (LVN_FIRST-6)
  3509. #define LVN_ENDLABELEDITW       (LVN_FIRST-76)
  3510. #define LVN_COLUMNCLICK         (LVN_FIRST-8)
  3511. #define LVN_BEGINDRAG           (LVN_FIRST-9)
  3512. #define LVN_BEGINRDRAG          (LVN_FIRST-11)
  3513.  
  3514. #if (_WIN32_IE >= 0x0300)
  3515. #define LVN_ODCACHEHINT         (LVN_FIRST-13)
  3516. #define LVN_ODFINDITEMA         (LVN_FIRST-52)
  3517. #define LVN_ODFINDITEMW         (LVN_FIRST-79)
  3518.  
  3519. #define LVN_ITEMACTIVATE        (LVN_FIRST-14)
  3520. #define LVN_ODSTATECHANGED      (LVN_FIRST-15)
  3521.  
  3522. #ifdef UNICODE
  3523. #define LVN_ODFINDITEM          LVN_ODFINDITEMW
  3524. #else
  3525. #define LVN_ODFINDITEM          LVN_ODFINDITEMA
  3526. #endif
  3527. #endif      // _WIN32_IE >= 0x0300
  3528.  
  3529.  
  3530. #if (_WIN32_IE >= 0x0400)
  3531. #define LVN_HOTTRACK            (LVN_FIRST-21)
  3532. #endif
  3533.  
  3534. #define LVN_GETDISPINFOA        (LVN_FIRST-50)
  3535. #define LVN_GETDISPINFOW        (LVN_FIRST-77)
  3536. #define LVN_SETDISPINFOA        (LVN_FIRST-51)
  3537. #define LVN_SETDISPINFOW        (LVN_FIRST-78)
  3538.  
  3539. #ifdef UNICODE
  3540. #define LVN_BEGINLABELEDIT      LVN_BEGINLABELEDITW
  3541. #define LVN_ENDLABELEDIT        LVN_ENDLABELEDITW
  3542. #define LVN_GETDISPINFO         LVN_GETDISPINFOW
  3543. #define LVN_SETDISPINFO         LVN_SETDISPINFOW
  3544. #else
  3545. #define LVN_BEGINLABELEDIT      LVN_BEGINLABELEDITA
  3546. #define LVN_ENDLABELEDIT        LVN_ENDLABELEDITA
  3547. #define LVN_GETDISPINFO         LVN_GETDISPINFOA
  3548. #define LVN_SETDISPINFO         LVN_SETDISPINFOA
  3549. #endif
  3550.  
  3551.  
  3552. #define LVIF_DI_SETITEM         0x1000
  3553.  
  3554. #if (_WIN32_IE >= 0x0300)
  3555. #define LV_DISPINFOA    NMLVDISPINFOA
  3556. #define LV_DISPINFOW    NMLVDISPINFOW
  3557. #else
  3558. #define tagLVDISPINFO   _LV_DISPINFO
  3559. #define NMLVDISPINFOA    LV_DISPINFOA
  3560. #define tagLVDISPINFOW  _LV_DISPINFOW
  3561. #define NMLVDISPINFOW    LV_DISPINFOW
  3562. #endif
  3563.  
  3564. #define LV_DISPINFO     NMLVDISPINFO
  3565.  
  3566. typedef struct tagLVDISPINFO {
  3567.     NMHDR hdr;
  3568.     LVITEMA item;
  3569. } NMLVDISPINFOA, FAR *LPNMLVDISPINFOA;
  3570.  
  3571. typedef struct tagLVDISPINFOW {
  3572.     NMHDR hdr;
  3573.     LVITEMW item;
  3574. } NMLVDISPINFOW, FAR * LPNMLVDISPINFOW;
  3575.  
  3576. #ifdef UNICODE
  3577. #define  NMLVDISPINFO           NMLVDISPINFOW
  3578. #else
  3579. #define  NMLVDISPINFO           NMLVDISPINFOA
  3580. #endif
  3581.  
  3582. #define LVN_KEYDOWN             (LVN_FIRST-55)
  3583.  
  3584. #if (_WIN32_IE >= 0x0300)
  3585. #define LV_KEYDOWN              NMLVKEYDOWN
  3586. #else
  3587. #define tagLVKEYDOWN            _LV_KEYDOWN
  3588. #define NMLVKEYDOWN              LV_KEYDOWN
  3589. #endif
  3590.  
  3591. typedef struct tagLVKEYDOWN
  3592. {
  3593.     NMHDR hdr;
  3594.     WORD wVKey;
  3595.     UINT flags;
  3596. } NMLVKEYDOWN, FAR *LPNMLVKEYDOWN;
  3597.  
  3598. #if (_WIN32_IE >= 0x0300)
  3599. #define LVN_MARQUEEBEGIN        (LVN_FIRST-56)
  3600. #endif
  3601.  
  3602. #if (_WIN32_IE >= 0x0400)
  3603. typedef struct tagNMLVGETINFOTIPA
  3604. {
  3605.     NMHDR hdr;
  3606.     DWORD dwFlags;
  3607.     LPSTR pszText;
  3608.     int cchTextMax;
  3609.     int iItem;
  3610.     int iSubItem;
  3611.     LPARAM lParam;
  3612. } NMLVGETINFOTIPA, *LPNMLVGETINFOTIPA;
  3613.  
  3614. typedef struct tagNMLVGETINFOTIPW
  3615. {
  3616.     NMHDR hdr;
  3617.     DWORD dwFlags;
  3618.     LPWSTR pszText;
  3619.     int cchTextMax;
  3620.     int iItem;
  3621.     int iSubItem;
  3622.     LPARAM lParam;
  3623. } NMLVGETINFOTIPW, *LPNMLVGETINFOTIPW;
  3624.  
  3625. // NMLVGETINFOTIPA.dwFlag values
  3626.  
  3627. #define LVGIT_UNFOLDED  0x0001
  3628.  
  3629. #define LVN_GETINFOTIPA          (LVN_FIRST-57)
  3630. #define LVN_GETINFOTIPW          (LVN_FIRST-58)
  3631.  
  3632. #ifdef UNICODE
  3633. #define LVN_GETINFOTIP          LVN_GETINFOTIPW
  3634. #define NMLVGETINFOTIP          NMLVGETINFOTIPW
  3635. #define LPNMLVGETINFOTIP        LPNMLVGETINFOTIPW
  3636. #else
  3637. #define LVN_GETINFOTIP          LVN_GETINFOTIPA
  3638. #define NMLVGETINFOTIP          NMLVGETINFOTIPA
  3639. #define LPNMLVGETINFOTIP        LPNMLVGETINFOTIPA
  3640. #endif
  3641.  
  3642.  
  3643. #endif      // _WIN32_IE >= 0x0400
  3644.  
  3645. #endif // NOLISTVIEW
  3646.  
  3647. //====== TREEVIEW CONTROL =====================================================
  3648.  
  3649. #ifndef NOTREEVIEW
  3650.  
  3651. #ifdef _WIN32
  3652. #define WC_TREEVIEWA            "SysTreeView32"
  3653. #define WC_TREEVIEWW            L"SysTreeView32"
  3654.  
  3655. #ifdef UNICODE
  3656. #define  WC_TREEVIEW            WC_TREEVIEWW
  3657. #else
  3658. #define  WC_TREEVIEW            WC_TREEVIEWA
  3659. #endif
  3660.  
  3661. #else
  3662. #define WC_TREEVIEW             "SysTreeView"
  3663. #endif
  3664.  
  3665. // begin_r_commctrl
  3666.  
  3667. #define TVS_HASBUTTONS          0x0001
  3668. #define TVS_HASLINES            0x0002
  3669. #define TVS_LINESATROOT         0x0004
  3670. #define TVS_EDITLABELS          0x0008
  3671. #define TVS_DISABLEDRAGDROP     0x0010
  3672. #define TVS_SHOWSELALWAYS       0x0020
  3673. #if (_WIN32_IE >= 0x0300)
  3674. #define TVS_RTLREADING          0x0040
  3675.  
  3676. #define TVS_NOTOOLTIPS          0x0080
  3677. #define TVS_CHECKBOXES          0x0100
  3678. #define TVS_TRACKSELECT         0x0200
  3679. #if (_WIN32_IE >= 0x0400)
  3680. #define TVS_SINGLEEXPAND        0x0400
  3681. #define TVS_INFOTIP             0x0800
  3682. #define TVS_FULLROWSELECT       0x1000
  3683. #define TVS_NOSCROLL            0x2000
  3684. #define TVS_NONEVENHEIGHT       0x4000
  3685. #endif
  3686.  
  3687. #endif
  3688.  
  3689. // end_r_commctrl
  3690.  
  3691. typedef struct _TREEITEM FAR* HTREEITEM;
  3692.  
  3693. #define TVIF_TEXT               0x0001
  3694. #define TVIF_IMAGE              0x0002
  3695. #define TVIF_PARAM              0x0004
  3696. #define TVIF_STATE              0x0008
  3697. #define TVIF_HANDLE             0x0010
  3698. #define TVIF_SELECTEDIMAGE      0x0020
  3699. #define TVIF_CHILDREN           0x0040
  3700. #if (_WIN32_IE >= 0x0400)
  3701. #define TVIF_INTEGRAL           0x0080
  3702. #endif
  3703. #define TVIS_SELECTED           0x0002
  3704. #define TVIS_CUT                0x0004
  3705. #define TVIS_DROPHILITED        0x0008
  3706. #define TVIS_BOLD               0x0010
  3707. #define TVIS_EXPANDED           0x0020
  3708. #define TVIS_EXPANDEDONCE       0x0040
  3709. #if (_WIN32_IE >= 0x0300)
  3710. #define TVIS_EXPANDPARTIAL      0x0080
  3711. #endif
  3712.  
  3713. #define TVIS_OVERLAYMASK        0x0F00
  3714. #define TVIS_STATEIMAGEMASK     0xF000
  3715. #define TVIS_USERMASK           0xF000
  3716.  
  3717. #define I_CHILDRENCALLBACK  (-1)
  3718.  
  3719. #if (_WIN32_IE >= 0x0300)
  3720. #define LPTV_ITEMW              LPTVITEMW
  3721. #define LPTV_ITEMA              LPTVITEMA
  3722. #define TV_ITEMW                TVITEMW
  3723. #define TV_ITEMA                TVITEMA
  3724. #else
  3725. #define tagTVITEMA             _TV_ITEMA
  3726. #define    TVITEMA              TV_ITEMA
  3727. #define  LPTVITEMA            LPTV_ITEMA
  3728. #define tagTVITEMW             _TV_ITEMW
  3729. #define    TVITEMW              TV_ITEMW
  3730. #define  LPTVITEMW            LPTV_ITEMW
  3731. #endif
  3732.  
  3733. #define LPTV_ITEM               LPTVITEM
  3734. #define TV_ITEM                 TVITEM
  3735.  
  3736. typedef struct tagTVITEMA {
  3737.     UINT      mask;
  3738.     HTREEITEM hItem;
  3739.     UINT      state;
  3740.     UINT      stateMask;
  3741.     LPSTR     pszText;
  3742.     int       cchTextMax;
  3743.     int       iImage;
  3744.     int       iSelectedImage;
  3745.     int       cChildren;
  3746.     LPARAM    lParam;
  3747. } TVITEMA, FAR *LPTVITEMA;
  3748.  
  3749. typedef struct tagTVITEMW {
  3750.     UINT      mask;
  3751.     HTREEITEM hItem;
  3752.     UINT      state;
  3753.     UINT      stateMask;
  3754.     LPWSTR    pszText;
  3755.     int       cchTextMax;
  3756.     int       iImage;
  3757.     int       iSelectedImage;
  3758.     int       cChildren;
  3759.     LPARAM    lParam;
  3760. } TVITEMW, FAR *LPTVITEMW;
  3761.  
  3762. #if (_WIN32_IE >= 0x0400)
  3763. // only used for Get and Set messages.  no notifies
  3764. typedef struct tagTVITEMEXA {
  3765.     UINT      mask;
  3766.     HTREEITEM hItem;
  3767.     UINT      state;
  3768.     UINT      stateMask;
  3769.     LPSTR     pszText;
  3770.     int       cchTextMax;
  3771.     int       iImage;
  3772.     int       iSelectedImage;
  3773.     int       cChildren;
  3774.     LPARAM    lParam;
  3775.     int       iIntegral;
  3776. } TVITEMEXA, FAR *LPTVITEMEXA;
  3777. // only used for Get and Set messages.  no notifies
  3778. typedef struct tagTVITEMEXW {
  3779.     UINT      mask;
  3780.     HTREEITEM hItem;
  3781.     UINT      state;
  3782.     UINT      stateMask;
  3783.     LPWSTR    pszText;
  3784.     int       cchTextMax;
  3785.     int       iImage;
  3786.     int       iSelectedImage;
  3787.     int       cChildren;
  3788.     LPARAM    lParam;
  3789.     int       iIntegral;
  3790. } TVITEMEXW, FAR *LPTVITEMEXW;
  3791. #ifdef UNICODE
  3792. typedef TVITEMEXW TVITEMEX;
  3793. typedef LPTVITEMEXW LPTVITEMEX;
  3794. #else
  3795. typedef TVITEMEXA TVITEMEX;
  3796. typedef LPTVITEMEXA LPTVITEMEX;
  3797. #endif // UNICODE
  3798.  
  3799. #endif
  3800.  
  3801. #ifdef UNICODE
  3802. #define  TVITEM                 TVITEMW
  3803. #define  LPTVITEM               LPTVITEMW
  3804. #else
  3805. #define  TVITEM                 TVITEMA
  3806. #define  LPTVITEM               LPTVITEMA
  3807. #endif
  3808.  
  3809.  
  3810. #define TVI_ROOT                ((HTREEITEM)0xFFFF0000)
  3811. #define TVI_FIRST               ((HTREEITEM)0xFFFF0001)
  3812. #define TVI_LAST                ((HTREEITEM)0xFFFF0002)
  3813. #define TVI_SORT                ((HTREEITEM)0xFFFF0003)
  3814.  
  3815. #if (_WIN32_IE >= 0x0300)
  3816. #define LPTV_INSERTSTRUCTA      LPTVINSERTSTRUCTA
  3817. #define LPTV_INSERTSTRUCTW      LPTVINSERTSTRUCTW
  3818. #define TV_INSERTSTRUCTA        TVINSERTSTRUCTA
  3819. #define TV_INSERTSTRUCTW        TVINSERTSTRUCTW
  3820. #else
  3821. #define tagTVINSERTSTRUCTA     _TV_INSERTSTRUCTA
  3822. #define    TVINSERTSTRUCTA      TV_INSERTSTRUCTA
  3823. #define  LPTVINSERTSTRUCTA    LPTV_INSERTSTRUCTA
  3824. #define tagTVINSERTSTRUCTW     _TV_INSERTSTRUCTW
  3825. #define    TVINSERTSTRUCTW      TV_INSERTSTRUCTW
  3826. #define  LPTVINSERTSTRUCTW    LPTV_INSERTSTRUCTW
  3827. #endif
  3828.  
  3829. #define TV_INSERTSTRUCT         TVINSERTSTRUCT
  3830. #define LPTV_INSERTSTRUCT       LPTVINSERTSTRUCT
  3831.  
  3832.  
  3833. #define TVINSERTSTRUCTA_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTA, item)
  3834. #define TVINSERTSTRUCTW_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTW, item)
  3835.  
  3836. typedef struct tagTVINSERTSTRUCTA {
  3837.     HTREEITEM hParent;
  3838.     HTREEITEM hInsertAfter;
  3839. #if (_WIN32_IE >= 0x0400)
  3840.     union
  3841.     {
  3842.         TVITEMEXA itemex;
  3843.         TV_ITEMA  item;
  3844.     } DUMMYUNIONNAME;
  3845. #else
  3846.     TV_ITEMA item;
  3847. #endif
  3848. } TVINSERTSTRUCTA, FAR *LPTVINSERTSTRUCTA;
  3849.  
  3850. typedef struct tagTVINSERTSTRUCTW {
  3851.     HTREEITEM hParent;
  3852.     HTREEITEM hInsertAfter;
  3853. #if (_WIN32_IE >= 0x0400)
  3854.     union
  3855.     {
  3856.         TVITEMEXW itemex;
  3857.         TV_ITEMW  item;
  3858.     } DUMMYUNIONNAME;
  3859. #else
  3860.     TV_ITEMW item;
  3861. #endif
  3862. } TVINSERTSTRUCTW, FAR *LPTVINSERTSTRUCTW;
  3863.  
  3864. #ifdef UNICODE
  3865. #define  TVINSERTSTRUCT         TVINSERTSTRUCTW
  3866. #define  LPTVINSERTSTRUCT       LPTVINSERTSTRUCTW
  3867. #define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTW_V1_SIZE
  3868. #else
  3869. #define  TVINSERTSTRUCT         TVINSERTSTRUCTA
  3870. #define  LPTVINSERTSTRUCT       LPTVINSERTSTRUCTA
  3871. #define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTA_V1_SIZE
  3872. #endif
  3873.  
  3874. #define TVM_INSERTITEMA         (TV_FIRST + 0)
  3875. #define TVM_INSERTITEMW         (TV_FIRST + 50)
  3876. #ifdef UNICODE
  3877. #define  TVM_INSERTITEM         TVM_INSERTITEMW
  3878. #else
  3879. #define  TVM_INSERTITEM         TVM_INSERTITEMA
  3880. #endif
  3881.  
  3882. #define TreeView_InsertItem(hwnd, lpis) \
  3883.     (HTREEITEM)SNDMSG((hwnd), TVM_INSERTITEM, 0, (LPARAM)(LPTV_INSERTSTRUCT)(lpis))
  3884.  
  3885.  
  3886. #define TVM_DELETEITEM          (TV_FIRST + 1)
  3887. #define TreeView_DeleteItem(hwnd, hitem) \
  3888.     (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hitem))
  3889.  
  3890.  
  3891. #define TreeView_DeleteAllItems(hwnd) \
  3892.     (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT)
  3893.  
  3894.  
  3895. #define TVM_EXPAND              (TV_FIRST + 2)
  3896. #define TreeView_Expand(hwnd, hitem, code) \
  3897.     (BOOL)SNDMSG((hwnd), TVM_EXPAND, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  3898.  
  3899.  
  3900. #define TVE_COLLAPSE            0x0001
  3901. #define TVE_EXPAND              0x0002
  3902. #define TVE_TOGGLE              0x0003
  3903. #if (_WIN32_IE >= 0x0300)
  3904. #define TVE_EXPANDPARTIAL       0x4000
  3905. #endif
  3906. #define TVE_COLLAPSERESET       0x8000
  3907.  
  3908.  
  3909. #define TVM_GETITEMRECT         (TV_FIRST + 4)
  3910. #define TreeView_GetItemRect(hwnd, hitem, prc, code) \
  3911.     (*(HTREEITEM FAR *)prc = (hitem), (BOOL)SNDMSG((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT FAR*)(prc)))
  3912.  
  3913.  
  3914. #define TVM_GETCOUNT            (TV_FIRST + 5)
  3915. #define TreeView_GetCount(hwnd) \
  3916.     (UINT)SNDMSG((hwnd), TVM_GETCOUNT, 0, 0)
  3917.  
  3918.  
  3919. #define TVM_GETINDENT           (TV_FIRST + 6)
  3920. #define TreeView_GetIndent(hwnd) \
  3921.     (UINT)SNDMSG((hwnd), TVM_GETINDENT, 0, 0)
  3922.  
  3923.  
  3924. #define TVM_SETINDENT           (TV_FIRST + 7)
  3925. #define TreeView_SetIndent(hwnd, indent) \
  3926.     (BOOL)SNDMSG((hwnd), TVM_SETINDENT, (WPARAM)indent, 0)
  3927.  
  3928.  
  3929. #define TVM_GETIMAGELIST        (TV_FIRST + 8)
  3930. #define TreeView_GetImageList(hwnd, iImage) \
  3931.     (HIMAGELIST)SNDMSG((hwnd), TVM_GETIMAGELIST, iImage, 0)
  3932.  
  3933.  
  3934. #define TVSIL_NORMAL            0
  3935. #define TVSIL_STATE             2
  3936.  
  3937.  
  3938. #define TVM_SETIMAGELIST        (TV_FIRST + 9)
  3939. #define TreeView_SetImageList(hwnd, himl, iImage) \
  3940.     (HIMAGELIST)SNDMSG((hwnd), TVM_SETIMAGELIST, iImage, (LPARAM)(UINT)(HIMAGELIST)(himl))
  3941.  
  3942.  
  3943. #define TVM_GETNEXTITEM         (TV_FIRST + 10)
  3944. #define TreeView_GetNextItem(hwnd, hitem, code) \
  3945.     (HTREEITEM)SNDMSG((hwnd), TVM_GETNEXTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  3946.  
  3947.  
  3948. #define TVGN_ROOT               0x0000
  3949. #define TVGN_NEXT               0x0001
  3950. #define TVGN_PREVIOUS           0x0002
  3951. #define TVGN_PARENT             0x0003
  3952. #define TVGN_CHILD              0x0004
  3953. #define TVGN_FIRSTVISIBLE       0x0005
  3954. #define TVGN_NEXTVISIBLE        0x0006
  3955. #define TVGN_PREVIOUSVISIBLE    0x0007
  3956. #define TVGN_DROPHILITE         0x0008
  3957. #define TVGN_CARET              0x0009
  3958. #if (_WIN32_IE >= 0x0400)
  3959. #define TVGN_LASTVISIBLE        0x000A
  3960. #endif      // _WIN32_IE >= 0x0400
  3961.  
  3962. #define TreeView_GetChild(hwnd, hitem)          TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD)
  3963. #define TreeView_GetNextSibling(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT)
  3964. #define TreeView_GetPrevSibling(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS)
  3965. #define TreeView_GetParent(hwnd, hitem)         TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT)
  3966. #define TreeView_GetFirstVisible(hwnd)          TreeView_GetNextItem(hwnd, NULL,  TVGN_FIRSTVISIBLE)
  3967. #define TreeView_GetNextVisible(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE)
  3968. #define TreeView_GetPrevVisible(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE)
  3969. #define TreeView_GetSelection(hwnd)             TreeView_GetNextItem(hwnd, NULL,  TVGN_CARET)
  3970. #define TreeView_GetDropHilight(hwnd)           TreeView_GetNextItem(hwnd, NULL,  TVGN_DROPHILITE)
  3971. #define TreeView_GetRoot(hwnd)                  TreeView_GetNextItem(hwnd, NULL,  TVGN_ROOT)
  3972. #if (_WIN32_IE >= 0x0400)
  3973. #define TreeView_GetLastVisible(hwnd)          TreeView_GetNextItem(hwnd, NULL,  TVGN_LASTVISIBLE)
  3974. #endif      // _WIN32_IE >= 0x0400
  3975.  
  3976.  
  3977. #define TVM_SELECTITEM          (TV_FIRST + 11)
  3978. #define TreeView_Select(hwnd, hitem, code) \
  3979.     (BOOL)SNDMSG((hwnd), TVM_SELECTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  3980.  
  3981.  
  3982. #define TreeView_SelectItem(hwnd, hitem)            TreeView_Select(hwnd, hitem, TVGN_CARET)
  3983. #define TreeView_SelectDropTarget(hwnd, hitem)      TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
  3984. #define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
  3985.  
  3986. #define TVM_GETITEMA            (TV_FIRST + 12)
  3987. #define TVM_GETITEMW            (TV_FIRST + 62)
  3988.  
  3989. #ifdef UNICODE
  3990. #define  TVM_GETITEM            TVM_GETITEMW
  3991. #else
  3992. #define  TVM_GETITEM            TVM_GETITEMA
  3993. #endif
  3994.  
  3995. #define TreeView_GetItem(hwnd, pitem) \
  3996.     (BOOL)SNDMSG((hwnd), TVM_GETITEM, 0, (LPARAM)(TV_ITEM FAR*)(pitem))
  3997.  
  3998.  
  3999. #define TVM_SETITEMA            (TV_FIRST + 13)
  4000. #define TVM_SETITEMW            (TV_FIRST + 63)
  4001.  
  4002. #ifdef UNICODE
  4003. #define  TVM_SETITEM            TVM_SETITEMW
  4004. #else
  4005. #define  TVM_SETITEM            TVM_SETITEMA
  4006. #endif
  4007.  
  4008. #define TreeView_SetItem(hwnd, pitem) \
  4009.     (BOOL)SNDMSG((hwnd), TVM_SETITEM, 0, (LPARAM)(const TV_ITEM FAR*)(pitem))
  4010.  
  4011.  
  4012. #define TVM_EDITLABELA          (TV_FIRST + 14)
  4013. #define TVM_EDITLABELW          (TV_FIRST + 65)
  4014. #ifdef UNICODE
  4015. #define TVM_EDITLABEL           TVM_EDITLABELW
  4016. #else
  4017. #define TVM_EDITLABEL           TVM_EDITLABELA
  4018. #endif
  4019.  
  4020. #define TreeView_EditLabel(hwnd, hitem) \
  4021.     (HWND)SNDMSG((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
  4022.  
  4023.  
  4024. #define TVM_GETEDITCONTROL      (TV_FIRST + 15)
  4025. #define TreeView_GetEditControl(hwnd) \
  4026.     (HWND)SNDMSG((hwnd), TVM_GETEDITCONTROL, 0, 0)
  4027.  
  4028.  
  4029. #define TVM_GETVISIBLECOUNT     (TV_FIRST + 16)
  4030. #define TreeView_GetVisibleCount(hwnd) \
  4031.     (UINT)SNDMSG((hwnd), TVM_GETVISIBLECOUNT, 0, 0)
  4032.  
  4033.  
  4034. #define TVM_HITTEST             (TV_FIRST + 17)
  4035. #define TreeView_HitTest(hwnd, lpht) \
  4036.     (HTREEITEM)SNDMSG((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht))
  4037.  
  4038.  
  4039. #if (_WIN32_IE >= 0x0300)
  4040. #define LPTV_HITTESTINFO   LPTVHITTESTINFO
  4041. #define   TV_HITTESTINFO     TVHITTESTINFO
  4042. #else
  4043. #define tagTVHITTESTINFO    _TV_HITTESTINFO
  4044. #define    TVHITTESTINFO     TV_HITTESTINFO
  4045. #define  LPTVHITTESTINFO   LPTV_HITTESTINFO
  4046. #endif
  4047.  
  4048. typedef struct tagTVHITTESTINFO {
  4049.     POINT       pt;
  4050.     UINT        flags;
  4051.     HTREEITEM   hItem;
  4052. } TVHITTESTINFO, FAR *LPTVHITTESTINFO;
  4053.  
  4054. #define TVHT_NOWHERE            0x0001
  4055. #define TVHT_ONITEMICON         0x0002
  4056. #define TVHT_ONITEMLABEL        0x0004
  4057. #define TVHT_ONITEM             (TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON)
  4058. #define TVHT_ONITEMINDENT       0x0008
  4059. #define TVHT_ONITEMBUTTON       0x0010
  4060. #define TVHT_ONITEMRIGHT        0x0020
  4061. #define TVHT_ONITEMSTATEICON    0x0040
  4062.  
  4063. #define TVHT_ABOVE              0x0100
  4064. #define TVHT_BELOW              0x0200
  4065. #define TVHT_TORIGHT            0x0400
  4066. #define TVHT_TOLEFT             0x0800
  4067.  
  4068.  
  4069. #define TVM_CREATEDRAGIMAGE     (TV_FIRST + 18)
  4070. #define TreeView_CreateDragImage(hwnd, hitem) \
  4071.     (HIMAGELIST)SNDMSG((hwnd), TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(hitem))
  4072.  
  4073.  
  4074. #define TVM_SORTCHILDREN        (TV_FIRST + 19)
  4075. #define TreeView_SortChildren(hwnd, hitem, recurse) \
  4076.     (BOOL)SNDMSG((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse, (LPARAM)(HTREEITEM)(hitem))
  4077.  
  4078.  
  4079. #define TVM_ENSUREVISIBLE       (TV_FIRST + 20)
  4080. #define TreeView_EnsureVisible(hwnd, hitem) \
  4081.     (BOOL)SNDMSG((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem))
  4082.  
  4083.  
  4084. #define TVM_SORTCHILDRENCB      (TV_FIRST + 21)
  4085. #define TreeView_SortChildrenCB(hwnd, psort, recurse) \
  4086.     (BOOL)SNDMSG((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \
  4087.     (LPARAM)(LPTV_SORTCB)(psort))
  4088.  
  4089.  
  4090. #define TVM_ENDEDITLABELNOW     (TV_FIRST + 22)
  4091. #define TreeView_EndEditLabelNow(hwnd, fCancel) \
  4092.     (BOOL)SNDMSG((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0)
  4093.  
  4094.  
  4095. #define TVM_GETISEARCHSTRINGA   (TV_FIRST + 23)
  4096. #define TVM_GETISEARCHSTRINGW   (TV_FIRST + 64)
  4097.  
  4098. #ifdef UNICODE
  4099. #define TVM_GETISEARCHSTRING     TVM_GETISEARCHSTRINGW
  4100. #else
  4101. #define TVM_GETISEARCHSTRING     TVM_GETISEARCHSTRINGA
  4102. #endif
  4103.  
  4104. #if (_WIN32_IE >= 0x0300)
  4105. #define TVM_SETTOOLTIPS         (TV_FIRST + 24)
  4106. #define TreeView_SetToolTips(hwnd,  hwndTT) \
  4107.     (HWND)SNDMSG((hwnd), TVM_SETTOOLTIPS, (WPARAM)hwndTT, 0)
  4108. #define TVM_GETTOOLTIPS         (TV_FIRST + 25)
  4109. #define TreeView_GetToolTips(hwnd) \
  4110.     (HWND)SNDMSG((hwnd), TVM_GETTOOLTIPS, 0, 0)
  4111. #endif
  4112.  
  4113. #define TreeView_GetISearchString(hwndTV, lpsz) \
  4114.         (BOOL)SNDMSG((hwndTV), TVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
  4115.  
  4116. #if (_WIN32_IE >= 0x0400)
  4117. #define TVM_SETINSERTMARK       (TV_FIRST + 26)
  4118. #define TreeView_SetInsertMark(hwnd, hItem, fAfter) \
  4119.         (BOOL)SNDMSG((hwnd), TVM_SETINSERTMARK, (WPARAM) (fAfter), (LPARAM) (hItem))
  4120.  
  4121. #define TVM_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  4122. #define TreeView_SetUnicodeFormat(hwnd, fUnicode)  \
  4123.     (BOOL)SNDMSG((hwnd), TVM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  4124.  
  4125. #define TVM_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  4126. #define TreeView_GetUnicodeFormat(hwnd)  \
  4127.     (BOOL)SNDMSG((hwnd), TVM_GETUNICODEFORMAT, 0, 0)
  4128.  
  4129. #endif
  4130.  
  4131. #if (_WIN32_IE >= 0x0400)
  4132. #define TVM_SETITEMHEIGHT         (TV_FIRST + 27)
  4133. #define TreeView_SetItemHeight(hwnd,  iHeight) \
  4134.     (int)SNDMSG((hwnd), TVM_SETITEMHEIGHT, (WPARAM)iHeight, 0)
  4135. #define TVM_GETITEMHEIGHT         (TV_FIRST + 28)
  4136. #define TreeView_GetItemHeight(hwnd) \
  4137.     (int)SNDMSG((hwnd), TVM_GETITEMHEIGHT, 0, 0)
  4138.  
  4139. #define TVM_SETBKCOLOR              (TV_FIRST + 29)
  4140. #define TreeView_SetBkColor(hwnd, clr) \
  4141.     (COLORREF)SNDMSG((hwnd), TVM_SETBKCOLOR, 0, (LPARAM)clr)
  4142.  
  4143. #define TVM_SETTEXTCOLOR              (TV_FIRST + 30)
  4144. #define TreeView_SetTextColor(hwnd, clr) \
  4145.     (COLORREF)SNDMSG((hwnd), TVM_SETTEXTCOLOR, 0, (LPARAM)clr)
  4146.  
  4147. #define TVM_GETBKCOLOR              (TV_FIRST + 31)
  4148. #define TreeView_GetBkColor(hwnd) \
  4149.     (COLORREF)SNDMSG((hwnd), TVM_GETBKCOLOR, 0, 0)
  4150.  
  4151. #define TVM_GETTEXTCOLOR              (TV_FIRST + 32)
  4152. #define TreeView_GetTextColor(hwnd) \
  4153.     (COLORREF)SNDMSG((hwnd), TVM_GETTEXTCOLOR, 0, 0)
  4154.  
  4155. #define TVM_SETSCROLLTIME              (TV_FIRST + 33)
  4156. #define TreeView_SetScrollTime(hwnd, uTime) \
  4157.     (UINT)SNDMSG((hwnd), TVM_SETSCROLLTIME, uTime, 0)
  4158.  
  4159. #define TVM_GETSCROLLTIME              (TV_FIRST + 34)
  4160. #define TreeView_GetScrollTime(hwnd) \
  4161.     (UINT)SNDMSG((hwnd), TVM_GETSCROLLTIME, 0, 0)
  4162.  
  4163.  
  4164. #if (_WIN32_IE >= 0x0400)
  4165. #define TVM_SETINSERTMARKCOLOR              (TV_FIRST + 37)
  4166. #define TreeView_SetInsertMarkColor(hwnd, clr) \
  4167.     (COLORREF)SNDMSG((hwnd), TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr)
  4168. #define TVM_GETINSERTMARKCOLOR              (TV_FIRST + 38)
  4169. #define TreeView_GetInsertMarkColor(hwnd) \
  4170.     (COLORREF)SNDMSG((hwnd), TVM_GETINSERTMARKCOLOR, 0, 0)
  4171. #endif  /* (_WIN32_IE >= 0x0400) */
  4172.  
  4173. #endif
  4174.  
  4175. typedef int (CALLBACK *PFNTVCOMPARE)(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  4176.  
  4177. #if (_WIN32_IE >= 0x0300)
  4178. #define LPTV_SORTCB    LPTVSORTCB
  4179. #define   TV_SORTCB      TVSORTCB
  4180. #else
  4181. #define tagTVSORTCB    _TV_SORTCB
  4182. #define    TVSORTCB     TV_SORTCB
  4183. #define  LPTVSORTCB   LPTV_SORTCB
  4184. #endif
  4185.  
  4186. typedef struct tagTVSORTCB
  4187. {
  4188.         HTREEITEM       hParent;
  4189.         PFNTVCOMPARE    lpfnCompare;
  4190.         LPARAM          lParam;
  4191. } TVSORTCB, FAR *LPTVSORTCB;
  4192.  
  4193.  
  4194. #if (_WIN32_IE >= 0x0300)
  4195. #define LPNM_TREEVIEWA          LPNMTREEVIEWA
  4196. #define LPNM_TREEVIEWW          LPNMTREEVIEWW
  4197. #define NM_TREEVIEWW            NMTREEVIEWW
  4198. #define NM_TREEVIEWA            NMTREEVIEWA
  4199. #else
  4200. #define tagNMTREEVIEWA          _NM_TREEVIEWA
  4201. #define tagNMTREEVIEWW          _NM_TREEVIEWW
  4202. #define NMTREEVIEWA             NM_TREEVIEWA
  4203. #define NMTREEVIEWW             NM_TREEVIEWW
  4204. #define LPNMTREEVIEWA           LPNM_TREEVIEWA
  4205. #define LPNMTREEVIEWW           LPNM_TREEVIEWW
  4206. #endif
  4207.  
  4208. #define LPNM_TREEVIEW           LPNMTREEVIEW
  4209. #define NM_TREEVIEW             NMTREEVIEW
  4210.  
  4211. typedef struct tagNMTREEVIEWA {
  4212.     NMHDR       hdr;
  4213.     UINT        action;
  4214.     TVITEMA    itemOld;
  4215.     TVITEMA    itemNew;
  4216.     POINT       ptDrag;
  4217. } NMTREEVIEWA, FAR *LPNMTREEVIEWA;
  4218.  
  4219.  
  4220. typedef struct tagNMTREEVIEWW {
  4221.     NMHDR       hdr;
  4222.     UINT        action;
  4223.     TVITEMW    itemOld;
  4224.     TVITEMW    itemNew;
  4225.     POINT       ptDrag;
  4226. } NMTREEVIEWW, FAR *LPNMTREEVIEWW;
  4227.  
  4228.  
  4229. #ifdef UNICODE
  4230. #define  NMTREEVIEW             NMTREEVIEWW
  4231. #define  LPNMTREEVIEW           LPNMTREEVIEWW
  4232. #else
  4233. #define  NMTREEVIEW             NMTREEVIEWA
  4234. #define  LPNMTREEVIEW           LPNMTREEVIEWA
  4235. #endif
  4236.  
  4237.  
  4238. #define TVN_SELCHANGINGA        (TVN_FIRST-1)
  4239. #define TVN_SELCHANGINGW        (TVN_FIRST-50)
  4240. #define TVN_SELCHANGEDA         (TVN_FIRST-2)
  4241. #define TVN_SELCHANGEDW         (TVN_FIRST-51)
  4242.  
  4243. #define TVC_UNKNOWN             0x0000
  4244. #define TVC_BYMOUSE             0x0001
  4245. #define TVC_BYKEYBOARD          0x0002
  4246.  
  4247. #define TVN_GETDISPINFOA        (TVN_FIRST-3)
  4248. #define TVN_GETDISPINFOW        (TVN_FIRST-52)
  4249. #define TVN_SETDISPINFOA        (TVN_FIRST-4)
  4250. #define TVN_SETDISPINFOW        (TVN_FIRST-53)
  4251.  
  4252. #define TVIF_DI_SETITEM         0x1000
  4253.  
  4254. #if (_WIN32_IE >= 0x0300)
  4255. #define TV_DISPINFOA            NMTVDISPINFOA
  4256. #define TV_DISPINFOW            NMTVDISPINFOW
  4257. #else
  4258. #define tagTVDISPINFOA  _TV_DISPINFOA
  4259. #define NMTVDISPINFOA    TV_DISPINFOA
  4260. #define tagTVDISPINFOW  _TV_DISPINFOW
  4261. #define NMTVDISPINFOW    TV_DISPINFOW
  4262. #endif
  4263.  
  4264. #define TV_DISPINFO             NMTVDISPINFO
  4265.  
  4266. typedef struct tagTVDISPINFOA {
  4267.     NMHDR hdr;
  4268.     TVITEMA item;
  4269. } NMTVDISPINFOA, FAR *LPNMTVDISPINFOA;
  4270.  
  4271. typedef struct tagTVDISPINFOW {
  4272.     NMHDR hdr;
  4273.     TVITEMW item;
  4274. } NMTVDISPINFOW, FAR *LPNMTVDISPINFOW;
  4275.  
  4276.  
  4277. #ifdef UNICODE
  4278. #define NMTVDISPINFO            NMTVDISPINFOW
  4279. #define LPNMTVDISPINFO          LPNMTVDISPINFOW
  4280. #else
  4281. #define NMTVDISPINFO            NMTVDISPINFOA
  4282. #define LPNMTVDISPINFO          LPNMTVDISPINFOA
  4283. #endif
  4284.  
  4285. #define TVN_ITEMEXPANDINGA      (TVN_FIRST-5)
  4286. #define TVN_ITEMEXPANDINGW      (TVN_FIRST-54)
  4287. #define TVN_ITEMEXPANDEDA       (TVN_FIRST-6)
  4288. #define TVN_ITEMEXPANDEDW       (TVN_FIRST-55)
  4289. #define TVN_BEGINDRAGA          (TVN_FIRST-7)
  4290. #define TVN_BEGINDRAGW          (TVN_FIRST-56)
  4291. #define TVN_BEGINRDRAGA         (TVN_FIRST-8)
  4292. #define TVN_BEGINRDRAGW         (TVN_FIRST-57)
  4293. #define TVN_DELETEITEMA         (TVN_FIRST-9)
  4294. #define TVN_DELETEITEMW         (TVN_FIRST-58)
  4295. #define TVN_BEGINLABELEDITA     (TVN_FIRST-10)
  4296. #define TVN_BEGINLABELEDITW     (TVN_FIRST-59)
  4297. #define TVN_ENDLABELEDITA       (TVN_FIRST-11)
  4298. #define TVN_ENDLABELEDITW       (TVN_FIRST-60)
  4299. #define TVN_KEYDOWN             (TVN_FIRST-12)
  4300.  
  4301. #if (_WIN32_IE >= 0x0400)
  4302. #define TVN_GETINFOTIPA         (TVN_FIRST-13)
  4303. #define TVN_GETINFOTIPW         (TVN_FIRST-14)
  4304. #define TVN_SINGLEEXPAND        (TVN_FIRST-15)
  4305. #endif // 0x400
  4306.  
  4307.  
  4308. #if (_WIN32_IE >= 0x0300)
  4309. #define TV_KEYDOWN      NMTVKEYDOWN
  4310. #else
  4311. #define tagTVKEYDOWN    _TV_KEYDOWN
  4312. #define  NMTVKEYDOWN     TV_KEYDOWN
  4313. #endif
  4314.  
  4315. typedef struct tagTVKEYDOWN {
  4316.     NMHDR hdr;
  4317.     WORD wVKey;
  4318.     UINT flags;
  4319. } NMTVKEYDOWN, FAR *LPNMTVKEYDOWN;
  4320.  
  4321.  
  4322. #ifdef UNICODE
  4323. #define TVN_SELCHANGING         TVN_SELCHANGINGW
  4324. #define TVN_SELCHANGED          TVN_SELCHANGEDW
  4325. #define TVN_GETDISPINFO         TVN_GETDISPINFOW
  4326. #define TVN_SETDISPINFO         TVN_SETDISPINFOW
  4327. #define TVN_ITEMEXPANDING       TVN_ITEMEXPANDINGW
  4328. #define TVN_ITEMEXPANDED        TVN_ITEMEXPANDEDW
  4329. #define TVN_BEGINDRAG           TVN_BEGINDRAGW
  4330. #define TVN_BEGINRDRAG          TVN_BEGINRDRAGW
  4331. #define TVN_DELETEITEM          TVN_DELETEITEMW
  4332. #define TVN_BEGINLABELEDIT      TVN_BEGINLABELEDITW
  4333. #define TVN_ENDLABELEDIT        TVN_ENDLABELEDITW
  4334. #else
  4335. #define TVN_SELCHANGING         TVN_SELCHANGINGA
  4336. #define TVN_SELCHANGED          TVN_SELCHANGEDA
  4337. #define TVN_GETDISPINFO         TVN_GETDISPINFOA
  4338. #define TVN_SETDISPINFO         TVN_SETDISPINFOA
  4339. #define TVN_ITEMEXPANDING       TVN_ITEMEXPANDINGA
  4340. #define TVN_ITEMEXPANDED        TVN_ITEMEXPANDEDA
  4341. #define TVN_BEGINDRAG           TVN_BEGINDRAGA
  4342. #define TVN_BEGINRDRAG          TVN_BEGINRDRAGA
  4343. #define TVN_DELETEITEM          TVN_DELETEITEMA
  4344. #define TVN_BEGINLABELEDIT      TVN_BEGINLABELEDITA
  4345. #define TVN_ENDLABELEDIT        TVN_ENDLABELEDITA
  4346. #endif
  4347.  
  4348. #if (_WIN32_IE >= 0x0300)
  4349. #define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW, clrTextBk)
  4350.  
  4351. typedef struct tagNMTVCUSTOMDRAW
  4352. {
  4353.     NMCUSTOMDRAW nmcd;
  4354.     COLORREF     clrText;
  4355.     COLORREF     clrTextBk;
  4356. #if (_WIN32_IE >= 0x0400)
  4357.     int iLevel;
  4358. #endif
  4359. } NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
  4360. #endif
  4361.  
  4362.  
  4363. #if (_WIN32_IE >= 0x0400)
  4364.  
  4365. // for tooltips
  4366.  
  4367. typedef struct tagNMTVGETINFOTIPA
  4368. {
  4369.     NMHDR hdr;
  4370.     LPSTR pszText;
  4371.     int cchTextMax;
  4372.     HTREEITEM hItem;
  4373.     LPARAM lParam;
  4374. } NMTVGETINFOTIPA, *LPNMTVGETINFOTIPA;
  4375.  
  4376. typedef struct tagNMTVGETINFOTIPW
  4377. {
  4378.     NMHDR hdr;
  4379.     LPWSTR pszText;
  4380.     int cchTextMax;
  4381.     HTREEITEM hItem;
  4382.     LPARAM lParam;
  4383. } NMTVGETINFOTIPW, *LPNMTVGETINFOTIPW;
  4384.  
  4385.  
  4386. #ifdef UNICODE
  4387. #define TVN_GETINFOTIP          TVN_GETINFOTIPW
  4388. #define NMTVGETINFOTIP          NMTVGETINFOTIPW
  4389. #define LPNMTVGETINFOTIP        LPNMTVGETINFOTIPW
  4390. #else
  4391. #define TVN_GETINFOTIP          TVN_GETINFOTIPA
  4392. #define NMTVGETINFOTIP          NMTVGETINFOTIPA
  4393. #define LPNMTVGETINFOTIP        LPNMTVGETINFOTIPA
  4394. #endif
  4395.  
  4396. // treeview's customdraw return meaning don't draw images.  valid on CDRF_NOTIFYITEMPREPAINT
  4397. #define TVCDRF_NOIMAGES         0x00010000
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404. #endif      // _WIN32_IE >= 0x0400
  4405.  
  4406. #endif      // NOTREEVIEW
  4407.  
  4408. #if (_WIN32_IE >= 0x0300)
  4409.  
  4410. #ifndef NOUSEREXCONTROLS
  4411.  
  4412. ////////////////////  ComboBoxEx ////////////////////////////////
  4413.  
  4414.  
  4415. #define WC_COMBOBOXEXW         L"ComboBoxEx32"
  4416. #define WC_COMBOBOXEXA         "ComboBoxEx32"
  4417.  
  4418. #ifdef UNICODE
  4419. #define WC_COMBOBOXEX          WC_COMBOBOXEXW
  4420. #else
  4421. #define WC_COMBOBOXEX          WC_COMBOBOXEXA
  4422. #endif
  4423.  
  4424.  
  4425. #define CBEIF_TEXT              0x00000001
  4426. #define CBEIF_IMAGE             0x00000002
  4427. #define CBEIF_SELECTEDIMAGE     0x00000004
  4428. #define CBEIF_OVERLAY           0x00000008
  4429. #define CBEIF_INDENT            0x00000010
  4430. #define CBEIF_LPARAM            0x00000020
  4431.  
  4432. #define CBEIF_DI_SETITEM        0x10000000
  4433.  
  4434. typedef struct tagCOMBOBOXEXITEMA
  4435. {
  4436.     UINT mask;
  4437.     int iItem;
  4438.     LPSTR pszText;
  4439.     int cchTextMax;
  4440.     int iImage;
  4441.     int iSelectedImage;
  4442.     int iOverlay;
  4443.     int iIndent;
  4444.     LPARAM lParam;
  4445. } COMBOBOXEXITEMA, *PCOMBOBOXEXITEMA;
  4446. typedef COMBOBOXEXITEMA CONST *PCCOMBOEXITEMA;
  4447.  
  4448.  
  4449. typedef struct tagCOMBOBOXEXITEMW
  4450. {
  4451.     UINT mask;
  4452.     int iItem;
  4453.     LPWSTR pszText;
  4454.     int cchTextMax;
  4455.     int iImage;
  4456.     int iSelectedImage;
  4457.     int iOverlay;
  4458.     int iIndent;
  4459.     LPARAM lParam;
  4460. } COMBOBOXEXITEMW, *PCOMBOBOXEXITEMW;
  4461. typedef COMBOBOXEXITEMW CONST *PCCOMBOEXITEMW;
  4462.  
  4463. #ifdef UNICODE
  4464. #define COMBOBOXEXITEM            COMBOBOXEXITEMW
  4465. #define PCOMBOBOXEXITEM           PCOMBOBOXEXITEMW
  4466. #define PCCOMBOBOXEXITEM          PCCOMBOBOXEXITEMW
  4467. #else
  4468. #define COMBOBOXEXITEM            COMBOBOXEXITEMA
  4469. #define PCOMBOBOXEXITEM           PCOMBOBOXEXITEMA
  4470. #define PCCOMBOBOXEXITEM          PCCOMBOBOXEXITEMA
  4471. #endif
  4472.  
  4473. #define CBEM_INSERTITEMA        (WM_USER + 1)
  4474. #define CBEM_SETIMAGELIST       (WM_USER + 2)
  4475. #define CBEM_GETIMAGELIST       (WM_USER + 3)
  4476. #define CBEM_GETITEMA           (WM_USER + 4)
  4477. #define CBEM_SETITEMA           (WM_USER + 5)
  4478. #define CBEM_DELETEITEM         CB_DELETESTRING
  4479. #define CBEM_GETCOMBOCONTROL    (WM_USER + 6)
  4480. #define CBEM_GETEDITCONTROL     (WM_USER + 7)
  4481. #if (_WIN32_IE >= 0x0400)
  4482. #define CBEM_SETEXSTYLE         (WM_USER + 8)  // use  SETEXTENDEDSTYLE instead
  4483. #define CBEM_SETEXTENDEDSTYLE   (WM_USER + 14)   // lparam == new style, wParam (optional) == mask
  4484. #define CBEM_GETEXSTYLE         (WM_USER + 9) // use GETEXTENDEDSTYLE instead
  4485. #define CBEM_GETEXTENDEDSTYLE   (WM_USER + 9)
  4486. #define CBEM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
  4487. #define CBEM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
  4488. #else
  4489. #define CBEM_SETEXSTYLE         (WM_USER + 8)
  4490. #define CBEM_GETEXSTYLE         (WM_USER + 9)
  4491. #endif
  4492. #define CBEM_HASEDITCHANGED     (WM_USER + 10)
  4493. #define CBEM_INSERTITEMW        (WM_USER + 11)
  4494. #define CBEM_SETITEMW           (WM_USER + 12)
  4495. #define CBEM_GETITEMW           (WM_USER + 13)
  4496.  
  4497. #ifdef UNICODE
  4498. #define CBEM_INSERTITEM         CBEM_INSERTITEMW
  4499. #define CBEM_SETITEM            CBEM_SETITEMW
  4500. #define CBEM_GETITEM            CBEM_GETITEMW
  4501. #else
  4502. #define CBEM_INSERTITEM         CBEM_INSERTITEMA
  4503. #define CBEM_SETITEM            CBEM_SETITEMA
  4504. #define CBEM_GETITEM            CBEM_GETITEMA
  4505. #endif
  4506.  
  4507. #define CBES_EX_NOEDITIMAGE          0x00000001
  4508. #define CBES_EX_NOEDITIMAGEINDENT    0x00000002
  4509. #define CBES_EX_PATHWORDBREAKPROC    0x00000004
  4510. #if (_WIN32_IE >= 0x0400)
  4511. #define CBES_EX_NOSIZELIMIT          0x00000008
  4512. #define CBES_EX_CASESENSITIVE        0x00000010
  4513.  
  4514. typedef struct {
  4515.     NMHDR hdr;
  4516.     COMBOBOXEXITEMA ceItem;
  4517. } NMCOMBOBOXEXA, *PNMCOMBOBOXEXA;
  4518.  
  4519. typedef struct {
  4520.     NMHDR hdr;
  4521.     COMBOBOXEXITEMW ceItem;
  4522. } NMCOMBOBOXEXW, *PNMCOMBOBOXEXW;
  4523.  
  4524. #ifdef UNICODE
  4525. #define NMCOMBOBOXEX            NMCOMBOBOXEXW
  4526. #define PNMCOMBOBOXEX           PNMCOMBOBOXEXW
  4527. #define CBEN_GETDISPINFO        CBEN_GETDISPINFOW
  4528. #else
  4529. #define NMCOMBOBOXEX            NMCOMBOBOXEXA
  4530. #define PNMCOMBOBOXEX           PNMCOMBOBOXEXA
  4531. #define CBEN_GETDISPINFO        CBEN_GETDISPINFOA
  4532. #endif
  4533.  
  4534. #else
  4535. typedef struct {
  4536.     NMHDR hdr;
  4537.     COMBOBOXEXITEM ceItem;
  4538. } NMCOMBOBOXEX, *PNMCOMBOBOXEX;
  4539.  
  4540. #define CBEN_GETDISPINFO         (CBEN_FIRST - 0)
  4541.  
  4542. #endif      // _WIN32_IE >= 0x0400
  4543.  
  4544. #if (_WIN32_IE >= 0x0400)
  4545. #define CBEN_GETDISPINFOA        (CBEN_FIRST - 0)
  4546. #endif
  4547. #define CBEN_INSERTITEM          (CBEN_FIRST - 1)
  4548. #define CBEN_DELETEITEM          (CBEN_FIRST - 2)
  4549. #define CBEN_BEGINEDIT           (CBEN_FIRST - 4)
  4550. #define CBEN_ENDEDITA            (CBEN_FIRST - 5)
  4551. #define CBEN_ENDEDITW            (CBEN_FIRST - 6)
  4552.  
  4553. #if (_WIN32_IE >= 0x0400)
  4554. #define CBEN_GETDISPINFOW        (CBEN_FIRST - 7)
  4555. #endif
  4556.  
  4557. #if (_WIN32_IE >= 0x0400)
  4558. #define CBEN_DRAGBEGINA             (CBEN_FIRST - 8)
  4559. #define CBEN_DRAGBEGINW             (CBEN_FIRST - 9)
  4560.  
  4561. #ifdef UNICODE
  4562. #define CBEN_DRAGBEGIN CBEN_DRAGBEGINW
  4563. #else
  4564. #define CBEN_DRAGBEGIN CBEN_DRAGBEGINA
  4565. #endif
  4566.  
  4567. #endif    //(_WIN32_IE >= 0x0400)
  4568.  
  4569. // lParam specifies why the endedit is happening
  4570. #ifdef UNICODE
  4571. #define CBEN_ENDEDIT CBEN_ENDEDITW
  4572. #else
  4573. #define CBEN_ENDEDIT CBEN_ENDEDITA
  4574. #endif
  4575.  
  4576. #define CBENF_KILLFOCUS         1
  4577. #define CBENF_RETURN            2
  4578. #define CBENF_ESCAPE            3
  4579. #define CBENF_DROPDOWN          4
  4580.  
  4581. #define CBEMAXSTRLEN 260
  4582.  
  4583. #if (_WIN32_IE >= 0x0400)
  4584. // CBEN_DRAGBEGIN sends this information ...
  4585.  
  4586. typedef struct {
  4587.     NMHDR hdr;
  4588.     int   iItemid;
  4589.     WCHAR szText[CBEMAXSTRLEN];
  4590. }NMCBEDRAGBEGINW, *LPNMCBEDRAGBEGINW, *PNMCBEDRAGBEGINW;
  4591.  
  4592.  
  4593. typedef struct {
  4594.     NMHDR hdr;
  4595.     int   iItemid;
  4596.     char szText[CBEMAXSTRLEN];
  4597. }NMCBEDRAGBEGINA, *LPNMCBEDRAGBEGINA, *PNMCBEDRAGBEGINA;
  4598.  
  4599. #ifdef UNICODE
  4600. #define  NMCBEDRAGBEGIN NMCBEDRAGBEGINW
  4601. #define  LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINW
  4602. #define  PNMCBEDRAGBEGIN PNMCBEDRAGBEGINW
  4603. #else
  4604. #define  NMCBEDRAGBEGIN NMCBEDRAGBEGINA
  4605. #define  LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINA
  4606. #define  PNMCBEDRAGBEGIN PNMCBEDRAGBEGINA
  4607. #endif
  4608. #endif      // _WIN32_IE >= 0x0400
  4609.  
  4610. // CBEN_ENDEDIT sends this information...
  4611. // fChanged if the user actually did anything
  4612. // iNewSelection gives what would be the new selection unless the notify is failed
  4613. //                      iNewSelection may be CB_ERR if there's no match
  4614. typedef struct {
  4615.         NMHDR hdr;
  4616.         BOOL fChanged;
  4617.         int iNewSelection;
  4618.         WCHAR szText[CBEMAXSTRLEN];
  4619.         int iWhy;
  4620. } NMCBEENDEDITW, *LPNMCBEENDEDITW, *PNMCBEENDEDITW;
  4621.  
  4622. typedef struct {
  4623.         NMHDR hdr;
  4624.         BOOL fChanged;
  4625.         int iNewSelection;
  4626.         char szText[CBEMAXSTRLEN];
  4627.         int iWhy;
  4628. } NMCBEENDEDITA, *LPNMCBEENDEDITA,*PNMCBEENDEDITA;
  4629.  
  4630. #ifdef UNICODE
  4631. #define  NMCBEENDEDIT NMCBEENDEDITW
  4632. #define  LPNMCBEENDEDIT LPNMCBEENDEDITW
  4633. #define  PNMCBEENDEDIT PNMCBEENDEDITW
  4634. #else
  4635. #define  NMCBEENDEDIT NMCBEENDEDITA
  4636. #define  LPNMCBEENDEDIT LPNMCBEENDEDITA
  4637. #define  PNMCBEENDEDIT PNMCBEENDEDITA
  4638. #endif
  4639.  
  4640. #endif
  4641.  
  4642. #endif      // _WIN32_IE >= 0x0300
  4643.  
  4644.  
  4645. //====== TAB CONTROL ==========================================================
  4646.  
  4647. #ifndef NOTABCONTROL
  4648.  
  4649. #ifdef _WIN32
  4650.  
  4651. #define WC_TABCONTROLA          "SysTabControl32"
  4652. #define WC_TABCONTROLW          L"SysTabControl32"
  4653.  
  4654. #ifdef UNICODE
  4655. #define  WC_TABCONTROL          WC_TABCONTROLW
  4656. #else
  4657. #define  WC_TABCONTROL          WC_TABCONTROLA
  4658. #endif
  4659.  
  4660. #else
  4661. #define WC_TABCONTROL           "SysTabControl"
  4662. #endif
  4663.  
  4664. // begin_r_commctrl
  4665.  
  4666. #if (_WIN32_IE >= 0x0300)
  4667. #define TCS_SCROLLOPPOSITE      0x0001   // assumes multiline tab
  4668. #define TCS_BOTTOM              0x0002
  4669. #define TCS_RIGHT               0x0002
  4670. #define TCS_MULTISELECT         0x0004  // allow multi-select in button mode
  4671. #endif
  4672. #if (_WIN32_IE >= 0x0400)
  4673. #define TCS_FLATBUTTONS         0x0008
  4674. #endif
  4675. #define TCS_FORCEICONLEFT       0x0010
  4676. #define TCS_FORCELABELLEFT      0x0020
  4677. #if (_WIN32_IE >= 0x0300)
  4678. #define TCS_HOTTRACK            0x0040
  4679. #define TCS_VERTICAL            0x0080
  4680. #endif
  4681. #define TCS_TABS                0x0000
  4682. #define TCS_BUTTONS             0x0100
  4683. #define TCS_SINGLELINE          0x0000
  4684. #define TCS_MULTILINE           0x0200
  4685. #define TCS_RIGHTJUSTIFY        0x0000
  4686. #define TCS_FIXEDWIDTH          0x0400
  4687. #define TCS_RAGGEDRIGHT         0x0800
  4688. #define TCS_FOCUSONBUTTONDOWN   0x1000
  4689. #define TCS_OWNERDRAWFIXED      0x2000
  4690. #define TCS_TOOLTIPS            0x4000
  4691. #define TCS_FOCUSNEVER          0x8000
  4692.  
  4693. #if (_WIN32_IE >= 0x0400)
  4694. // EX styles for use with TCM_SETEXTENDEDSTYLE
  4695. #define TCS_EX_FLATSEPARATORS   0x00000001
  4696. #define TCS_EX_REGISTERDROP     0x00000002
  4697. #endif
  4698.  
  4699. // end_r_commctrl
  4700.  
  4701.  
  4702. #define TCM_GETIMAGELIST        (TCM_FIRST + 2)
  4703. #define TabCtrl_GetImageList(hwnd) \
  4704.     (HIMAGELIST)SNDMSG((hwnd), TCM_GETIMAGELIST, 0, 0L)
  4705.  
  4706.  
  4707. #define TCM_SETIMAGELIST        (TCM_FIRST + 3)
  4708. #define TabCtrl_SetImageList(hwnd, himl) \
  4709.     (HIMAGELIST)SNDMSG((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl))
  4710.  
  4711.  
  4712. #define TCM_GETITEMCOUNT        (TCM_FIRST + 4)
  4713. #define TabCtrl_GetItemCount(hwnd) \
  4714.     (int)SNDMSG((hwnd), TCM_GETITEMCOUNT, 0, 0L)
  4715.  
  4716.  
  4717. #define TCIF_TEXT               0x0001
  4718. #define TCIF_IMAGE              0x0002
  4719. #define TCIF_RTLREADING         0x0004
  4720. #define TCIF_PARAM              0x0008
  4721. #if (_WIN32_IE >= 0x0300)
  4722. #define TCIF_STATE              0x0010
  4723.  
  4724.  
  4725. #define TCIS_BUTTONPRESSED      0x0001
  4726. #endif
  4727. #if (_WIN32_IE >= 0x0400)
  4728. #define TCIS_HIGHLIGHTED        0x0002
  4729. #endif
  4730.  
  4731. #if (_WIN32_IE >= 0x0300)
  4732. #define TC_ITEMHEADERA         TCITEMHEADERA
  4733. #define TC_ITEMHEADERW         TCITEMHEADERW
  4734. #else
  4735. #define tagTCITEMHEADERA       _TC_ITEMHEADERA
  4736. #define    TCITEMHEADERA        TC_ITEMHEADERA
  4737. #define tagTCITEMHEADERW       _TC_ITEMHEADERW
  4738. #define    TCITEMHEADERW        TC_ITEMHEADERW
  4739. #endif
  4740. #define TC_ITEMHEADER          TCITEMHEADER
  4741.  
  4742. typedef struct tagTCITEMHEADERA
  4743. {
  4744.     UINT mask;
  4745.     UINT lpReserved1;
  4746.     UINT lpReserved2;
  4747.     LPSTR pszText;
  4748.     int cchTextMax;
  4749.     int iImage;
  4750. } TCITEMHEADERA, FAR *LPTCITEMHEADERA;
  4751.  
  4752. typedef struct tagTCITEMHEADERW
  4753. {
  4754.     UINT mask;
  4755.     UINT lpReserved1;
  4756.     UINT lpReserved2;
  4757.     LPWSTR pszText;
  4758.     int cchTextMax;
  4759.     int iImage;
  4760. } TCITEMHEADERW, FAR *LPTCITEMHEADERW;
  4761.  
  4762. #ifdef UNICODE
  4763. #define  TCITEMHEADER          TCITEMHEADERW
  4764. #define  LPTCITEMHEADER        LPTCITEMHEADERW
  4765. #else
  4766. #define  TCITEMHEADER          TCITEMHEADERA
  4767. #define  LPTCITEMHEADER        LPTCITEMHEADERA
  4768. #endif
  4769.  
  4770.  
  4771. #if (_WIN32_IE >= 0x0300)
  4772. #define TC_ITEMA                TCITEMA
  4773. #define TC_ITEMW                TCITEMW
  4774. #else
  4775. #define tagTCITEMA              _TC_ITEMA
  4776. #define    TCITEMA               TC_ITEMA
  4777. #define tagTCITEMW              _TC_ITEMW
  4778. #define    TCITEMW               TC_ITEMW
  4779. #endif
  4780. #define TC_ITEM                 TCITEM
  4781.  
  4782. typedef struct tagTCITEMA
  4783. {
  4784.     UINT mask;
  4785. #if (_WIN32_IE >= 0x0300)
  4786.     DWORD dwState;
  4787.     DWORD dwStateMask;
  4788. #else
  4789.     UINT lpReserved1;
  4790.     UINT lpReserved2;
  4791. #endif
  4792.     LPSTR pszText;
  4793.     int cchTextMax;
  4794.     int iImage;
  4795.  
  4796.     LPARAM lParam;
  4797. } TCITEMA, FAR *LPTCITEMA;
  4798.  
  4799. typedef struct tagTCITEMW
  4800. {
  4801.     UINT mask;
  4802. #if (_WIN32_IE >= 0x0300)
  4803.     DWORD dwState;
  4804.     DWORD dwStateMask;
  4805. #else
  4806.     UINT lpReserved1;
  4807.     UINT lpReserved2;
  4808. #endif
  4809.     LPWSTR pszText;
  4810.     int cchTextMax;
  4811.     int iImage;
  4812.  
  4813.     LPARAM lParam;
  4814. } TCITEMW, FAR *LPTCITEMW;
  4815.  
  4816. #ifdef UNICODE
  4817. #define  TCITEM                 TCITEMW
  4818. #define  LPTCITEM               LPTCITEMW
  4819. #else
  4820. #define  TCITEM                 TCITEMA
  4821. #define  LPTCITEM               LPTCITEMA
  4822. #endif
  4823.  
  4824.  
  4825. #define TCM_GETITEMA            (TCM_FIRST + 5)
  4826. #define TCM_GETITEMW            (TCM_FIRST + 60)
  4827.  
  4828. #ifdef UNICODE
  4829. #define TCM_GETITEM             TCM_GETITEMW
  4830. #else
  4831. #define TCM_GETITEM             TCM_GETITEMA
  4832. #endif
  4833.  
  4834. #define TabCtrl_GetItem(hwnd, iItem, pitem) \
  4835.     (BOOL)SNDMSG((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
  4836.  
  4837.  
  4838. #define TCM_SETITEMA            (TCM_FIRST + 6)
  4839. #define TCM_SETITEMW            (TCM_FIRST + 61)
  4840.  
  4841. #ifdef UNICODE
  4842. #define TCM_SETITEM             TCM_SETITEMW
  4843. #else
  4844. #define TCM_SETITEM             TCM_SETITEMA
  4845. #endif
  4846.  
  4847. #define TabCtrl_SetItem(hwnd, iItem, pitem) \
  4848.     (BOOL)SNDMSG((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
  4849.  
  4850.  
  4851. #define TCM_INSERTITEMA         (TCM_FIRST + 7)
  4852. #define TCM_INSERTITEMW         (TCM_FIRST + 62)
  4853.  
  4854. #ifdef UNICODE
  4855. #define TCM_INSERTITEM          TCM_INSERTITEMW
  4856. #else
  4857. #define TCM_INSERTITEM          TCM_INSERTITEMA
  4858. #endif
  4859.  
  4860. #define TabCtrl_InsertItem(hwnd, iItem, pitem)   \
  4861.     (int)SNDMSG((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM FAR*)(pitem))
  4862.  
  4863.  
  4864. #define TCM_DELETEITEM          (TCM_FIRST + 8)
  4865. #define TabCtrl_DeleteItem(hwnd, i) \
  4866.     (BOOL)SNDMSG((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L)
  4867.  
  4868.  
  4869. #define TCM_DELETEALLITEMS      (TCM_FIRST + 9)
  4870. #define TabCtrl_DeleteAllItems(hwnd) \
  4871.     (BOOL)SNDMSG((hwnd), TCM_DELETEALLITEMS, 0, 0L)
  4872.  
  4873.  
  4874. #define TCM_GETITEMRECT         (TCM_FIRST + 10)
  4875. #define TabCtrl_GetItemRect(hwnd, i, prc) \
  4876.     (BOOL)SNDMSG((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT FAR*)(prc))
  4877.  
  4878.  
  4879. #define TCM_GETCURSEL           (TCM_FIRST + 11)
  4880. #define TabCtrl_GetCurSel(hwnd) \
  4881.     (int)SNDMSG((hwnd), TCM_GETCURSEL, 0, 0)
  4882.  
  4883.  
  4884. #define TCM_SETCURSEL           (TCM_FIRST + 12)
  4885. #define TabCtrl_SetCurSel(hwnd, i) \
  4886.     (int)SNDMSG((hwnd), TCM_SETCURSEL, (WPARAM)i, 0)
  4887.  
  4888.  
  4889. #define TCHT_NOWHERE            0x0001
  4890. #define TCHT_ONITEMICON         0x0002
  4891. #define TCHT_ONITEMLABEL        0x0004
  4892. #define TCHT_ONITEM             (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
  4893.  
  4894. #if (_WIN32_IE >= 0x0300)
  4895. #define LPTC_HITTESTINFO        LPTCHITTESTINFO
  4896. #define TC_HITTESTINFO          TCHITTESTINFO
  4897. #else
  4898. #define tagTCHITTESTINFO        _TC_HITTESTINFO
  4899. #define    TCHITTESTINFO         TC_HITTESTINFO
  4900. #define  LPTCHITTESTINFO       LPTC_HITTESTINFO
  4901. #endif
  4902.  
  4903. typedef struct tagTCHITTESTINFO
  4904. {
  4905.     POINT pt;
  4906.     UINT flags;
  4907. } TCHITTESTINFO, FAR * LPTCHITTESTINFO;
  4908.  
  4909. #define TCM_HITTEST             (TCM_FIRST + 13)
  4910. #define TabCtrl_HitTest(hwndTC, pinfo) \
  4911.     (int)SNDMSG((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO FAR*)(pinfo))
  4912.  
  4913.  
  4914. #define TCM_SETITEMEXTRA        (TCM_FIRST + 14)
  4915. #define TabCtrl_SetItemExtra(hwndTC, cb) \
  4916.     (BOOL)SNDMSG((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L)
  4917.  
  4918.  
  4919. #define TCM_ADJUSTRECT          (TCM_FIRST + 40)
  4920. #define TabCtrl_AdjustRect(hwnd, bLarger, prc) \
  4921.     (int)SNDMSG(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT FAR *)prc)
  4922.  
  4923.  
  4924. #define TCM_SETITEMSIZE         (TCM_FIRST + 41)
  4925. #define TabCtrl_SetItemSize(hwnd, x, y) \
  4926.     (DWORD)SNDMSG((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y))
  4927.  
  4928.  
  4929. #define TCM_REMOVEIMAGE         (TCM_FIRST + 42)
  4930. #define TabCtrl_RemoveImage(hwnd, i) \
  4931.         (void)SNDMSG((hwnd), TCM_REMOVEIMAGE, i, 0L)
  4932.  
  4933.  
  4934. #define TCM_SETPADDING          (TCM_FIRST + 43)
  4935. #define TabCtrl_SetPadding(hwnd,  cx, cy) \
  4936.         (void)SNDMSG((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
  4937.  
  4938.  
  4939. #define TCM_GETROWCOUNT         (TCM_FIRST + 44)
  4940. #define TabCtrl_GetRowCount(hwnd) \
  4941.         (int)SNDMSG((hwnd), TCM_GETROWCOUNT, 0, 0L)
  4942.  
  4943.  
  4944. #define TCM_GETTOOLTIPS         (TCM_FIRST + 45)
  4945. #define TabCtrl_GetToolTips(hwnd) \
  4946.         (HWND)SNDMSG((hwnd), TCM_GETTOOLTIPS, 0, 0L)
  4947.  
  4948.  
  4949. #define TCM_SETTOOLTIPS         (TCM_FIRST + 46)
  4950. #define TabCtrl_SetToolTips(hwnd, hwndTT) \
  4951.         (void)SNDMSG((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L)
  4952.  
  4953.  
  4954. #define TCM_GETCURFOCUS         (TCM_FIRST + 47)
  4955. #define TabCtrl_GetCurFocus(hwnd) \
  4956.     (int)SNDMSG((hwnd), TCM_GETCURFOCUS, 0, 0)
  4957.  
  4958. #define TCM_SETCURFOCUS         (TCM_FIRST + 48)
  4959. #define TabCtrl_SetCurFocus(hwnd, i) \
  4960.     SNDMSG((hwnd),TCM_SETCURFOCUS, i, 0)
  4961.  
  4962. #if (_WIN32_IE >= 0x0300)
  4963. #define TCM_SETMINTABWIDTH      (TCM_FIRST + 49)
  4964. #define TabCtrl_SetMinTabWidth(hwnd, x) \
  4965.         (int)SNDMSG((hwnd), TCM_SETMINTABWIDTH, 0, x)
  4966.  
  4967.  
  4968. #define TCM_DESELECTALL         (TCM_FIRST + 50)
  4969. #define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\
  4970.         (void)SNDMSG((hwnd), TCM_DESELECTALL, fExcludeFocus, 0)
  4971. #endif
  4972.  
  4973. #if (_WIN32_IE >= 0x0400)
  4974.  
  4975. #define TCM_HIGHLIGHTITEM       (TCM_FIRST + 51)
  4976. #define TabCtrl_HighlightItem(hwnd, i, fHighlight) \
  4977.     (BOOL)SNDMSG((hwnd), TCM_HIGHLIGHTITEM, (WPARAM)i, (LPARAM)MAKELONG (fHighlight, 0))
  4978.  
  4979. #define TCM_SETEXTENDEDSTYLE    (TCM_FIRST + 52)  // optional wParam == mask
  4980. #define TabCtrl_SetExtendedStyle(hwnd, dw)\
  4981.         (DWORD)SNDMSG((hwnd), TCM_SETEXTENDEDSTYLE, 0, dw)
  4982.  
  4983. #define TCM_GETEXTENDEDSTYLE    (TCM_FIRST + 53)
  4984. #define TabCtrl_GetExtendedStyle(hwnd)\
  4985.         (DWORD)SNDMSG((hwnd), TCM_GETEXTENDEDSTYLE, 0, 0)
  4986.  
  4987. #define TCM_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  4988. #define TabCtrl_SetUnicodeFormat(hwnd, fUnicode)  \
  4989.     (BOOL)SNDMSG((hwnd), TCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  4990.  
  4991. #define TCM_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  4992. #define TabCtrl_GetUnicodeFormat(hwnd)  \
  4993.     (BOOL)SNDMSG((hwnd), TCM_GETUNICODEFORMAT, 0, 0)
  4994.  
  4995. #endif      // _WIN32_IE >= 0x0400
  4996.  
  4997. #define TCN_KEYDOWN             (TCN_FIRST - 0)
  4998.  
  4999. #if (_WIN32_IE >= 0x0300)
  5000. #define TC_KEYDOWN              NMTCKEYDOWN
  5001. #else
  5002. #define tagTCKEYDOWN            _TC_KEYDOWN
  5003. #define  NMTCKEYDOWN             TC_KEYDOWN
  5004. #endif
  5005.  
  5006. typedef struct tagTCKEYDOWN
  5007. {
  5008.     NMHDR hdr;
  5009.     WORD wVKey;
  5010.     UINT flags;
  5011. } NMTCKEYDOWN;
  5012.  
  5013. #define TCN_SELCHANGE           (TCN_FIRST - 1)
  5014. #define TCN_SELCHANGING         (TCN_FIRST - 2)
  5015. #if (_WIN32_IE >= 0x0400)
  5016. #define TCN_GETOBJECT           (TCN_FIRST - 3)
  5017. #endif      // _WIN32_IE >= 0x0400
  5018.  
  5019. #endif      // NOTABCONTROL
  5020.  
  5021.  
  5022.  
  5023.  
  5024. //====== ANIMATE CONTROL ======================================================
  5025.  
  5026. #ifndef NOANIMATE
  5027.  
  5028. #ifdef _WIN32
  5029.  
  5030. #define ANIMATE_CLASSW          L"SysAnimate32"
  5031. #define ANIMATE_CLASSA          "SysAnimate32"
  5032.  
  5033. #ifdef UNICODE
  5034. #define ANIMATE_CLASS           ANIMATE_CLASSW
  5035. #else
  5036. #define ANIMATE_CLASS           ANIMATE_CLASSA
  5037. #endif
  5038.  
  5039. // begin_r_commctrl
  5040.  
  5041. #define ACS_CENTER              0x0001
  5042. #define ACS_TRANSPARENT         0x0002
  5043. #define ACS_AUTOPLAY            0x0004
  5044. #if (_WIN32_IE >= 0x0300)
  5045. #define ACS_TIMER               0x0008  // don't use threads... use timers
  5046. #endif
  5047.  
  5048. // end_r_commctrl
  5049.  
  5050. #define ACM_OPENA               (WM_USER+100)
  5051. #define ACM_OPENW               (WM_USER+103)
  5052.  
  5053. #ifdef UNICODE
  5054. #define ACM_OPEN                ACM_OPENW
  5055. #else
  5056. #define ACM_OPEN                ACM_OPENA
  5057. #endif
  5058.  
  5059. #define ACM_PLAY                (WM_USER+101)
  5060. #define ACM_STOP                (WM_USER+102)
  5061.  
  5062.  
  5063. #define ACN_START               1
  5064. #define ACN_STOP                2
  5065.  
  5066.  
  5067. #define Animate_Create(hwndP, id, dwStyle, hInstance)   \
  5068.             CreateWindow(ANIMATE_CLASS, NULL,           \
  5069.                 dwStyle, 0, 0, 0, 0, hwndP, (HMENU)(id), hInstance, NULL)
  5070.  
  5071. #define Animate_Open(hwnd, szName)          (BOOL)SNDMSG(hwnd, ACM_OPEN, 0, (LPARAM)(LPTSTR)(szName))
  5072. #define Animate_OpenEx(hwnd, hInst, szName) (BOOL)SNDMSG(hwnd, ACM_OPEN, (WPARAM)hInst, (LPARAM)(LPTSTR)(szName))
  5073. #define Animate_Play(hwnd, from, to, rep)   (BOOL)SNDMSG(hwnd, ACM_PLAY, (WPARAM)(UINT)(rep), (LPARAM)MAKELONG(from, to))
  5074. #define Animate_Stop(hwnd)                  (BOOL)SNDMSG(hwnd, ACM_STOP, 0, 0)
  5075. #define Animate_Close(hwnd)                 Animate_Open(hwnd, NULL)
  5076. #define Animate_Seek(hwnd, frame)           Animate_Play(hwnd, frame, frame, 1)
  5077. #endif
  5078.  
  5079. #endif      // NOANIMATE
  5080.  
  5081. #if (_WIN32_IE >= 0x0300)
  5082. //====== MONTHCAL CONTROL ======================================================
  5083.  
  5084. #ifndef NOMONTHCAL
  5085. #ifdef _WIN32
  5086.  
  5087. #define MONTHCAL_CLASSW          L"SysMonthCal32"
  5088. #define MONTHCAL_CLASSA          "SysMonthCal32"
  5089.  
  5090. #ifdef UNICODE
  5091. #define MONTHCAL_CLASS           MONTHCAL_CLASSW
  5092. #else
  5093. #define MONTHCAL_CLASS           MONTHCAL_CLASSA
  5094. #endif
  5095.  
  5096. // bit-packed array of "bold" info for a month
  5097. // if a bit is on, that day is drawn bold
  5098. typedef DWORD MONTHDAYSTATE, FAR * LPMONTHDAYSTATE;
  5099.  
  5100.  
  5101. #define MCM_FIRST           0x1000
  5102.  
  5103. // BOOL MonthCal_GetCurSel(HWND hmc, LPSYSTEMTIME pst)
  5104. //   returns FALSE if MCS_MULTISELECT
  5105. //   returns TRUE and sets *pst to the currently selected date otherwise
  5106. #define MCM_GETCURSEL       (MCM_FIRST + 1)
  5107. #define MonthCal_GetCurSel(hmc, pst)    (BOOL)SNDMSG(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst))
  5108.  
  5109. // BOOL MonthCal_SetCurSel(HWND hmc, LPSYSTEMTIME pst)
  5110. //   returns FALSE if MCS_MULTISELECT
  5111. //   returns TURE and sets the currently selected date to *pst otherwise
  5112. #define MCM_SETCURSEL       (MCM_FIRST + 2)
  5113. #define MonthCal_SetCurSel(hmc, pst)    (BOOL)SNDMSG(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst))
  5114.  
  5115. // DWORD MonthCal_GetMaxSelCount(HWND hmc)
  5116. //   returns the maximum number of selectable days allowed
  5117. #define MCM_GETMAXSELCOUNT  (MCM_FIRST + 3)
  5118. #define MonthCal_GetMaxSelCount(hmc)    (DWORD)SNDMSG(hmc, MCM_GETMAXSELCOUNT, 0, 0L)
  5119.  
  5120. // BOOL MonthCal_SetMaxSelCount(HWND hmc, UINT n)
  5121. //   sets the max number days that can be selected iff MCS_MULTISELECT
  5122. #define MCM_SETMAXSELCOUNT  (MCM_FIRST + 4)
  5123. #define MonthCal_SetMaxSelCount(hmc, n) (BOOL)SNDMSG(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L)
  5124.  
  5125. // BOOL MonthCal_GetSelRange(HWND hmc, LPSYSTEMTIME rgst)
  5126. //   sets rgst[0] to the first day of the selection range
  5127. //   sets rgst[1] to the last day of the selection range
  5128. #define MCM_GETSELRANGE     (MCM_FIRST + 5)
  5129. #define MonthCal_GetSelRange(hmc, rgst) SNDMSG(hmc, MCM_GETSELRANGE, 0, (LPARAM)(rgst))
  5130.  
  5131. // BOOL MonthCal_SetSelRange(HWND hmc, LPSYSTEMTIME rgst)
  5132. //   selects the range of days from rgst[0] to rgst[1]
  5133. #define MCM_SETSELRANGE     (MCM_FIRST + 6)
  5134. #define MonthCal_SetSelRange(hmc, rgst) SNDMSG(hmc, MCM_SETSELRANGE, 0, (LPARAM)(rgst))
  5135.  
  5136. // DWORD MonthCal_GetMonthRange(HWND hmc, DWORD gmr, LPSYSTEMTIME rgst)
  5137. //   if rgst specified, sets rgst[0] to the starting date and
  5138. //      and rgst[1] to the ending date of the the selectable (non-grayed)
  5139. //      days if GMR_VISIBLE or all the displayed days (including grayed)
  5140. //      if GMR_DAYSTATE.
  5141. //   returns the number of months spanned by the above range.
  5142. #define MCM_GETMONTHRANGE   (MCM_FIRST + 7)
  5143. #define MonthCal_GetMonthRange(hmc, gmr, rgst)  (DWORD)SNDMSG(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst))
  5144.  
  5145. // BOOL MonthCal_SetDayState(HWND hmc, int cbds, DAYSTATE *rgds)
  5146. //   cbds is the count of DAYSTATE items in rgds and it must be equal
  5147. //   to the value returned from MonthCal_GetMonthRange(hmc, GMR_DAYSTATE, NULL)
  5148. //   This sets the DAYSTATE bits for each month (grayed and non-grayed
  5149. //   days) displayed in the calendar. The first bit in a month's DAYSTATE
  5150. //   corresponts to bolding day 1, the second bit affects day 2, etc.
  5151. #define MCM_SETDAYSTATE     (MCM_FIRST + 8)
  5152. #define MonthCal_SetDayState(hmc, cbds, rgds)   SNDMSG(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds))
  5153.  
  5154. // BOOL MonthCal_GetMinReqRect(HWND hmc, LPRECT prc)
  5155. //   sets *prc the minimal size needed to display one month
  5156. //   To display two months, undo the AdjustWindowRect calculation already done to
  5157. //   this rect, double the width, and redo the AdjustWindowRect calculation --
  5158. //   the monthcal control will display two calendars in this window (if you also
  5159. //   double the vertical size, you will get 4 calendars)
  5160. //   NOTE: if you want to gurantee that the "Today" string is not clipped,
  5161. //   get the MCM_GETMAXTODAYWIDTH and use the max of that width and this width
  5162. #define MCM_GETMINREQRECT   (MCM_FIRST + 9)
  5163. #define MonthCal_GetMinReqRect(hmc, prc)        SNDMSG(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc))
  5164.  
  5165. // set colors to draw control with -- see MCSC_ bits below
  5166. #define MCM_SETCOLOR            (MCM_FIRST + 10)
  5167. #define MonthCal_SetColor(hmc, iColor, clr) SNDMSG(hmc, MCM_SETCOLOR, iColor, clr)
  5168.  
  5169. #define MCM_GETCOLOR            (MCM_FIRST + 11)
  5170. #define MonthCal_GetColor(hmc, iColor) SNDMSG(hmc, MCM_SETCOLOR, iColor, 0)
  5171.  
  5172. #define MCSC_BACKGROUND   0   // the background color (between months)
  5173. #define MCSC_TEXT         1   // the dates
  5174. #define MCSC_TITLEBK      2   // background of the title
  5175. #define MCSC_TITLETEXT    3
  5176. #define MCSC_MONTHBK      4   // background within the month cal
  5177. #define MCSC_TRAILINGTEXT 5   // the text color of header & trailing days
  5178.  
  5179. // set what day is "today"   send NULL to revert back to real date
  5180. #define MCM_SETTODAY    (MCM_FIRST + 12)
  5181. #define MonthCal_SetToday(hmc, pst)             SNDMSG(hmc, MCM_SETTODAY, 0, (LPARAM)pst)
  5182.  
  5183. // get what day is "today"
  5184. // returns BOOL for success/failure
  5185. #define MCM_GETTODAY    (MCM_FIRST + 13)
  5186. #define MonthCal_GetToday(hmc, pst)             (BOOL)SNDMSG(hmc, MCM_GETTODAY, 0, (LPARAM)pst)
  5187.  
  5188. // determine what pinfo->pt is over
  5189. #define MCM_HITTEST          (MCM_FIRST + 14)
  5190. #define MonthCal_HitTest(hmc, pinfo) \
  5191.         SNDMSG(hmc, MCM_HITTEST, 0, (LPARAM)(PMCHITTESTINFO)pinfo)
  5192.  
  5193. typedef struct {
  5194.         UINT cbSize;
  5195.         POINT pt;
  5196.  
  5197.         UINT uHit;   // out param
  5198.         SYSTEMTIME st;
  5199. } MCHITTESTINFO, *PMCHITTESTINFO;
  5200.  
  5201. #define MCHT_TITLE                      0x00010000
  5202. #define MCHT_CALENDAR                   0x00020000
  5203. #define MCHT_TODAYLINK                  0x00030000
  5204.  
  5205. #define MCHT_NEXT                       0x01000000   // these indicate that hitting
  5206. #define MCHT_PREV                       0x02000000  // here will go to the next/prev month
  5207.  
  5208. #define MCHT_NOWHERE                    0x00000000
  5209.  
  5210. #define MCHT_TITLEBK                    (MCHT_TITLE)
  5211. #define MCHT_TITLEMONTH                 (MCHT_TITLE | 0x0001)
  5212. #define MCHT_TITLEYEAR                  (MCHT_TITLE | 0x0002)
  5213. #define MCHT_TITLEBTNNEXT               (MCHT_TITLE | MCHT_NEXT | 0x0003)
  5214. #define MCHT_TITLEBTNPREV               (MCHT_TITLE | MCHT_PREV | 0x0003)
  5215.  
  5216. #define MCHT_CALENDARBK                 (MCHT_CALENDAR)
  5217. #define MCHT_CALENDARDATE               (MCHT_CALENDAR | 0x0001)
  5218. #define MCHT_CALENDARDATENEXT           (MCHT_CALENDARDATE | MCHT_NEXT)
  5219. #define MCHT_CALENDARDATEPREV           (MCHT_CALENDARDATE | MCHT_PREV)
  5220. #define MCHT_CALENDARDAY                (MCHT_CALENDAR | 0x0002)
  5221. #define MCHT_CALENDARWEEKNUM            (MCHT_CALENDAR | 0x0003)
  5222.  
  5223. // set first day of week to iDay:
  5224. // 0 for Monday, 1 for Tuesday, ..., 6 for Sunday
  5225. // -1 for means use locale info
  5226. #define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15)
  5227. #define MonthCal_SetFirstDayOfWeek(hmc, iDay) \
  5228.         SNDMSG(hmc, MCM_SETFIRSTDAYOFWEEK, 0, iDay)
  5229.  
  5230. // DWORD result...  low word has the day.  high word is bool if this is app set
  5231. // or not (FALSE == using locale info)
  5232. #define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16)
  5233. #define MonthCal_GetFirstDayOfWeek(hmc) \
  5234.         (DWORD)SNDMSG(hmc, MCM_GETFIRSTDAYOFWEEK, 0, 0)
  5235.  
  5236. // DWORD MonthCal_GetRange(HWND hmc, LPSYSTEMTIME rgst)
  5237. //   modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
  5238. //   modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
  5239. //   returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
  5240. #define MCM_GETRANGE (MCM_FIRST + 17)
  5241. #define MonthCal_GetRange(hmc, rgst) \
  5242.         (DWORD)SNDMSG(hmc, MCM_GETRANGE, 0, (LPARAM)(rgst))
  5243.  
  5244. // BOOL MonthCal_SetRange(HWND hmc, DWORD gdtr, LPSYSTEMTIME rgst)
  5245. //   if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
  5246. //   if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
  5247. //   returns TRUE on success, FALSE on error (such as invalid parameters)
  5248. #define MCM_SETRANGE (MCM_FIRST + 18)
  5249. #define MonthCal_SetRange(hmc, gd, rgst) \
  5250.         (BOOL)SNDMSG(hmc, MCM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
  5251.  
  5252. // int MonthCal_GetMonthDelta(HWND hmc)
  5253. //   returns the number of months one click on a next/prev button moves by
  5254. #define MCM_GETMONTHDELTA (MCM_FIRST + 19)
  5255. #define MonthCal_GetMonthDelta(hmc) \
  5256.         (int)SNDMSG(hmc, MCM_GETMONTHDELTA, 0, 0)
  5257.  
  5258. // int MonthCal_SetMonthDelta(HWND hmc, int n)
  5259. //   sets the month delta to n. n==0 reverts to moving by a page of months
  5260. //   returns the previous value of n.
  5261. #define MCM_SETMONTHDELTA (MCM_FIRST + 20)
  5262. #define MonthCal_SetMonthDelta(hmc, n) \
  5263.         (int)SNDMSG(hmc, MCM_SETMONTHDELTA, n, 0)
  5264.  
  5265. // DWORD MonthCal_GetMaxTodayWidth(HWND hmc, LPSIZE psz)
  5266. //   sets *psz to the maximum width/height of the "Today" string displayed
  5267. //   at the bottom of the calendar (as long as MCS_NOTODAY is not specified)
  5268. #define MCM_GETMAXTODAYWIDTH (MCM_FIRST + 21)
  5269. #define MonthCal_GetMaxTodayWidth(hmc) \
  5270.         (DWORD)SNDMSG(hmc, MCM_GETMAXTODAYWIDTH, 0, 0)
  5271.  
  5272. #if (_WIN32_IE >= 0x0400)
  5273. #define MCM_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  5274. #define MonthCal_SetUnicodeFormat(hwnd, fUnicode)  \
  5275.     (BOOL)SNDMSG((hwnd), MCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  5276.  
  5277. #define MCM_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  5278. #define MonthCal_GetUnicodeFormat(hwnd)  \
  5279.     (BOOL)SNDMSG((hwnd), MCM_GETUNICODEFORMAT, 0, 0)
  5280. #endif
  5281.  
  5282. // MCN_SELCHANGE is sent whenever the currently displayed date changes
  5283. // via month change, year change, keyboard navigation, prev/next button
  5284. //
  5285. typedef struct tagNMSELCHANGE
  5286. {
  5287.     NMHDR           nmhdr;  // this must be first, so we don't break WM_NOTIFY
  5288.  
  5289.     SYSTEMTIME      stSelStart;
  5290.     SYSTEMTIME      stSelEnd;
  5291. } NMSELCHANGE, FAR * LPNMSELCHANGE;
  5292.  
  5293. #define MCN_SELCHANGE       (MCN_FIRST + 1)
  5294.  
  5295. // MCN_GETDAYSTATE is sent for MCS_DAYSTATE controls whenever new daystate
  5296. // information is needed (month or year scroll) to draw bolding information.
  5297. // The app must fill in cDayState months worth of information starting from
  5298. // stStart date. The app may fill in the array at prgDayState or change
  5299. // prgDayState to point to a different array out of which the information
  5300. // will be copied. (similar to tooltips)
  5301. //
  5302. typedef struct tagNMDAYSTATE
  5303. {
  5304.     NMHDR           nmhdr;  // this must be first, so we don't break WM_NOTIFY
  5305.  
  5306.     SYSTEMTIME      stStart;
  5307.     int             cDayState;
  5308.  
  5309.     LPMONTHDAYSTATE prgDayState; // points to cDayState MONTHDAYSTATEs
  5310. } NMDAYSTATE, FAR * LPNMDAYSTATE;
  5311.  
  5312. #define MCN_GETDAYSTATE     (MCN_FIRST + 3)
  5313.  
  5314. // MCN_SELECT is sent whenever a selection has occured (via mouse or keyboard)
  5315. //
  5316. typedef NMSELCHANGE NMSELECT, FAR * LPNMSELECT;
  5317.  
  5318.  
  5319. #define MCN_SELECT          (MCN_FIRST + 4)
  5320.  
  5321.  
  5322. #define MCS_DAYSTATE        0x0001
  5323. #define MCS_MULTISELECT     0x0002
  5324. #define MCS_WEEKNUMBERS     0x0004
  5325. #if (_WIN32_IE >= 0x0400)
  5326. #define MCS_NOTODAYCIRCLE   0x0008
  5327. #define MCS_NOTODAY         0x0010
  5328. #else
  5329. #define MCS_NOTODAY         0x0008
  5330. #endif
  5331.  
  5332. #define GMR_VISIBLE     0       // visible portion of display
  5333. #define GMR_DAYSTATE    1       // above plus the grayed out parts of
  5334.                                 // partially displayed months
  5335.  
  5336.  
  5337. #endif // _WIN32
  5338. #endif // NOMONTHCAL
  5339.  
  5340.  
  5341. //====== DATETIMEPICK CONTROL ==================================================
  5342.  
  5343. #ifndef NODATETIMEPICK
  5344. #ifdef _WIN32
  5345.  
  5346. #define DATETIMEPICK_CLASSW          L"SysDateTimePick32"
  5347. #define DATETIMEPICK_CLASSA          "SysDateTimePick32"
  5348.  
  5349. #ifdef UNICODE
  5350. #define DATETIMEPICK_CLASS           DATETIMEPICK_CLASSW
  5351. #else
  5352. #define DATETIMEPICK_CLASS           DATETIMEPICK_CLASSA
  5353. #endif
  5354.  
  5355. #define DTM_FIRST        0x1000
  5356.  
  5357. // DWORD DateTimePick_GetSystemtime(HWND hdp, LPSYSTEMTIME pst)
  5358. //   returns GDT_NONE if "none" is selected (DTS_SHOWNONE only)
  5359. //   returns GDT_VALID and modifies *pst to be the currently selected value
  5360. #define DTM_GETSYSTEMTIME   (DTM_FIRST + 1)
  5361. #define DateTime_GetSystemtime(hdp, pst)    (DWORD)SNDMSG(hdp, DTM_GETSYSTEMTIME, 0, (LPARAM)(pst))
  5362.  
  5363. // BOOL DateTime_SetSystemtime(HWND hdp, DWORD gd, LPSYSTEMTIME pst)
  5364. //   if gd==GDT_NONE, sets datetimepick to None (DTS_SHOWNONE only)
  5365. //   if gd==GDT_VALID, sets datetimepick to *pst
  5366. //   returns TRUE on success, FALSE on error (such as bad params)
  5367. #define DTM_SETSYSTEMTIME   (DTM_FIRST + 2)
  5368. #define DateTime_SetSystemtime(hdp, gd, pst)    (BOOL)SNDMSG(hdp, DTM_SETSYSTEMTIME, (LPARAM)(gd), (LPARAM)(pst))
  5369.  
  5370. // DWORD DateTime_GetRange(HWND hdp, LPSYSTEMTIME rgst)
  5371. //   modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
  5372. //   modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
  5373. //   returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
  5374. #define DTM_GETRANGE (DTM_FIRST + 3)
  5375. #define DateTime_GetRange(hdp, rgst)  (DWORD)SNDMSG(hdp, DTM_GETRANGE, 0, (LPARAM)(rgst))
  5376.  
  5377. // BOOL DateTime_SetRange(HWND hdp, DWORD gdtr, LPSYSTEMTIME rgst)
  5378. //   if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
  5379. //   if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
  5380. //   returns TRUE on success, FALSE on error (such as invalid parameters)
  5381. #define DTM_SETRANGE (DTM_FIRST + 4)
  5382. #define DateTime_SetRange(hdp, gd, rgst)  (BOOL)SNDMSG(hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
  5383.  
  5384. // BOOL DateTime_SetFormat(HWND hdp, LPCTSTR sz)
  5385. //   sets the display formatting string to sz (see GetDateFormat and GetTimeFormat for valid formatting chars)
  5386. //   NOTE: 'X' is a valid formatting character which indicates that the application
  5387. //   will determine how to display information. Such apps must support DTN_WMKEYDOWN,
  5388. //   DTN_FORMAT, and DTN_FORMATQUERY.
  5389. #define DTM_SETFORMATA (DTM_FIRST + 5)
  5390. #define DTM_SETFORMATW (DTM_FIRST + 50)
  5391.  
  5392. #ifdef UNICODE
  5393. #define DTM_SETFORMAT       DTM_SETFORMATW
  5394. #else
  5395. #define DTM_SETFORMAT       DTM_SETFORMATA
  5396. #endif
  5397.  
  5398. #define DateTime_SetFormat(hdp, sz)  (BOOL)SNDMSG(hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
  5399.  
  5400.  
  5401. #define DTM_SETMCCOLOR    (DTM_FIRST + 6)
  5402. #define DateTime_SetMonthCalColor(hdp, iColor, clr) SNDMSG(hdp, DTM_SETMCCOLOR, iColor, clr)
  5403.  
  5404. #define DTM_GETMCCOLOR    (DTM_FIRST + 7)
  5405. #define DateTime_GetMonthCalColor(hdp, iColor) SNDMSG(hdp, DTM_GETMCCOLOR, iColor, 0)
  5406.  
  5407. // HWND DateTime_GetMonthCal(HWND hdp)
  5408. //   returns the HWND of the MonthCal popup window. Only valid
  5409. // between DTN_DROPDOWN and DTN_CLOSEUP notifications.
  5410. #define DTM_GETMONTHCAL   (DTM_FIRST + 8)
  5411. #define DateTime_GetMonthCal(hdp) (HWND)SNDMSG(hdp, DTM_GETMONTHCAL, 0, 0)
  5412.  
  5413. #if (_WIN32_IE >= 0x0400)
  5414.  
  5415. #define DTM_SETMCFONT     (DTM_FIRST + 9)
  5416. #define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) SNDMSG(hdp, DTM_SETMCFONT, (WPARAM)hfont, (LPARAM)fRedraw)
  5417.  
  5418. #define DTM_GETMCFONT     (DTM_FIRST + 10)
  5419. #define DateTime_GetMonthCalFont(hdp) SNDMSG(hdp, DTM_GETMCFONT, 0, 0)
  5420.  
  5421. #endif      // _WIN32_IE >= 0x0400
  5422.  
  5423. #define DTS_UPDOWN          0x0001 // use UPDOWN instead of MONTHCAL
  5424. #define DTS_SHOWNONE        0x0002 // allow a NONE selection
  5425. #define DTS_SHORTDATEFORMAT 0x0000 // use the short date format (app must forward WM_WININICHANGE messages)
  5426. #define DTS_LONGDATEFORMAT  0x0004 // use the long date format (app must forward WM_WININICHANGE messages)
  5427. #define DTS_TIMEFORMAT      0x0009 // use the time format (app must forward WM_WININICHANGE messages)
  5428. #define DTS_APPCANPARSE     0x0010 // allow user entered strings (app MUST respond to DTN_USERSTRING)
  5429. #define DTS_RIGHTALIGN      0x0020 // right-align popup instead of left-align it
  5430.  
  5431. #define DTN_DATETIMECHANGE  (DTN_FIRST + 1) // the systemtime has changed
  5432. typedef struct tagNMDATETIMECHANGE
  5433. {
  5434.     NMHDR       nmhdr;
  5435.     DWORD       dwFlags;    // GDT_VALID or GDT_NONE
  5436.     SYSTEMTIME  st;         // valid iff dwFlags==GDT_VALID
  5437. } NMDATETIMECHANGE, FAR * LPNMDATETIMECHANGE;
  5438.  
  5439. #define DTN_USERSTRINGA  (DTN_FIRST + 2) // the user has entered a string
  5440. #define DTN_USERSTRINGW  (DTN_FIRST + 15)
  5441. typedef struct tagNMDATETIMESTRINGA
  5442. {
  5443.     NMHDR      nmhdr;
  5444.     LPCSTR     pszUserString;  // string user entered
  5445.     SYSTEMTIME st;             // app fills this in
  5446.     DWORD      dwFlags;        // GDT_VALID or GDT_NONE
  5447. } NMDATETIMESTRINGA, FAR * LPNMDATETIMESTRINGA;
  5448.  
  5449. typedef struct tagNMDATETIMESTRINGW
  5450. {
  5451.     NMHDR      nmhdr;
  5452.     LPCWSTR    pszUserString;  // string user entered
  5453.     SYSTEMTIME st;             // app fills this in
  5454.     DWORD      dwFlags;        // GDT_VALID or GDT_NONE
  5455. } NMDATETIMESTRINGW, FAR * LPNMDATETIMESTRINGW;
  5456.  
  5457. #ifdef UNICODE
  5458. #define DTN_USERSTRING          DTN_USERSTRINGW
  5459. #define NMDATETIMESTRING        NMDATETIMESTRINGW
  5460. #define LPNMDATETIMESTRING      LPNMDATETIMESTRINGW
  5461. #else
  5462. #define DTN_USERSTRING          DTN_USERSTRINGA
  5463. #define NMDATETIMESTRING        NMDATETIMESTRINGA
  5464. #define LPNMDATETIMESTRING      LPNMDATETIMESTRINGA
  5465. #endif
  5466.  
  5467.  
  5468. #define DTN_WMKEYDOWNA  (DTN_FIRST + 3) // modify keydown on app format field (X)
  5469. #define DTN_WMKEYDOWNW  (DTN_FIRST + 16)
  5470. typedef struct tagNMDATETIMEWMKEYDOWNA
  5471. {
  5472.     NMHDR      nmhdr;
  5473.     int        nVirtKey;  // virtual key code of WM_KEYDOWN which MODIFIES an X field
  5474.     LPCSTR     pszFormat; // format substring
  5475.     SYSTEMTIME st;        // current systemtime, app should modify based on key
  5476. } NMDATETIMEWMKEYDOWNA, FAR * LPNMDATETIMEWMKEYDOWNA;
  5477.  
  5478. typedef struct tagNMDATETIMEWMKEYDOWNW
  5479. {
  5480.     NMHDR      nmhdr;
  5481.     int        nVirtKey;  // virtual key code of WM_KEYDOWN which MODIFIES an X field
  5482.     LPCWSTR    pszFormat; // format substring
  5483.     SYSTEMTIME st;        // current systemtime, app should modify based on key
  5484. } NMDATETIMEWMKEYDOWNW, FAR * LPNMDATETIMEWMKEYDOWNW;
  5485.  
  5486. #ifdef UNICODE
  5487. #define DTN_WMKEYDOWN           DTN_WMKEYDOWNW
  5488. #define NMDATETIMEWMKEYDOWN     NMDATETIMEWMKEYDOWNW
  5489. #define LPNMDATETIMEWMKEYDOWN   LPNMDATETIMEWMKEYDOWNW
  5490. #else
  5491. #define DTN_WMKEYDOWN           DTN_WMKEYDOWNA
  5492. #define NMDATETIMEWMKEYDOWN     NMDATETIMEWMKEYDOWNA
  5493. #define LPNMDATETIMEWMKEYDOWN   LPNMDATETIMEWMKEYDOWNA
  5494. #endif
  5495.  
  5496.  
  5497. #define DTN_FORMATA  (DTN_FIRST + 4) // query display for app format field (X)
  5498. #define DTN_FORMATW  (DTN_FIRST + 17)
  5499. typedef struct tagNMDATETIMEFORMATA
  5500. {
  5501.     NMHDR nmhdr;
  5502.     LPCSTR  pszFormat;   // format substring
  5503.     SYSTEMTIME st;       // current systemtime
  5504.     LPCSTR pszDisplay;   // string to display
  5505.     CHAR szDisplay[64];  // buffer pszDisplay originally points at
  5506. } NMDATETIMEFORMATA, FAR * LPNMDATETIMEFORMATA;
  5507.  
  5508. typedef struct tagNMDATETIMEFORMATW
  5509. {
  5510.     NMHDR nmhdr;
  5511.     LPCWSTR pszFormat;   // format substring
  5512.     SYSTEMTIME st;       // current systemtime
  5513.     LPCWSTR pszDisplay;  // string to display
  5514.     WCHAR szDisplay[64]; // buffer pszDisplay originally points at
  5515. } NMDATETIMEFORMATW, FAR * LPNMDATETIMEFORMATW;
  5516.  
  5517. #ifdef UNICODE
  5518. #define DTN_FORMAT             DTN_FORMATW
  5519. #define NMDATETIMEFORMAT        NMDATETIMEFORMATW
  5520. #define LPNMDATETIMEFORMAT      LPNMDATETIMEFORMATW
  5521. #else
  5522. #define DTN_FORMAT             DTN_FORMATA
  5523. #define NMDATETIMEFORMAT        NMDATETIMEFORMATA
  5524. #define LPNMDATETIMEFORMAT      LPNMDATETIMEFORMATA
  5525. #endif
  5526.  
  5527.  
  5528. #define DTN_FORMATQUERYA  (DTN_FIRST + 5) // query formatting info for app format field (X)
  5529. #define DTN_FORMATQUERYW (DTN_FIRST + 18)
  5530. typedef struct tagNMDATETIMEFORMATQUERYA
  5531. {
  5532.     NMHDR nmhdr;
  5533.     LPCSTR pszFormat;  // format substring
  5534.     SIZE szMax;        // max bounding rectangle app will use for this format string
  5535. } NMDATETIMEFORMATQUERYA, FAR * LPNMDATETIMEFORMATQUERYA;
  5536.  
  5537. typedef struct tagNMDATETIMEFORMATQUERYW
  5538. {
  5539.     NMHDR nmhdr;
  5540.     LPCWSTR pszFormat; // format substring
  5541.     SIZE szMax;        // max bounding rectangle app will use for this format string
  5542. } NMDATETIMEFORMATQUERYW, FAR * LPNMDATETIMEFORMATQUERYW;
  5543.  
  5544. #ifdef UNICODE
  5545. #define DTN_FORMATQUERY         DTN_FORMATQUERYW
  5546. #define NMDATETIMEFORMATQUERY   NMDATETIMEFORMATQUERYW
  5547. #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYW
  5548. #else
  5549. #define DTN_FORMATQUERY         DTN_FORMATQUERYA
  5550. #define NMDATETIMEFORMATQUERY   NMDATETIMEFORMATQUERYA
  5551. #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYA
  5552. #endif
  5553.  
  5554.  
  5555. #define DTN_DROPDOWN    (DTN_FIRST + 6) // MonthCal has dropped down
  5556. #define DTN_CLOSEUP     (DTN_FIRST + 7) // MonthCal is popping up
  5557.  
  5558.  
  5559. #define GDTR_MIN     0x0001
  5560. #define GDTR_MAX     0x0002
  5561.  
  5562. #define GDT_ERROR    -1
  5563. #define GDT_VALID    0
  5564. #define GDT_NONE     1
  5565.  
  5566.  
  5567. #endif // _WIN32
  5568. #endif // NODATETIMEPICK
  5569.  
  5570.  
  5571. #if (_WIN32_IE >= 0x0400)
  5572.  
  5573. #ifndef NOIPADDRESS
  5574.  
  5575. ///////////////////////////////////////////////
  5576. ///    IP Address edit control
  5577.  
  5578. // Messages sent to IPAddress controls
  5579.  
  5580. #define IPM_CLEARADDRESS (WM_USER+100) // no parameters
  5581. #define IPM_SETADDRESS   (WM_USER+101) // lparam = TCP/IP address
  5582. #define IPM_GETADDRESS   (WM_USER+102) // lresult = # of non black fields.  lparam = LPDWORD for TCP/IP address
  5583. #define IPM_SETRANGE (WM_USER+103) // wparam = field, lparam = range
  5584. #define IPM_SETFOCUS (WM_USER+104) // wparam = field
  5585. #define IPM_ISBLANK  (WM_USER+105) // no parameters
  5586.  
  5587. #define WC_IPADDRESSW           L"SysIPAddress32"
  5588. #define WC_IPADDRESSA           "SysIPAddress32"
  5589.  
  5590. #ifdef UNICODE
  5591. #define WC_IPADDRESS          WC_IPADDRESSW
  5592. #else
  5593. #define WC_IPADDRESS          WC_IPADDRESSA
  5594. #endif
  5595.  
  5596. #define IPN_FIELDCHANGED                (IPN_FIRST - 0)
  5597. typedef struct tagNMIPADDRESS
  5598. {
  5599.         NMHDR hdr;
  5600.         int iField;
  5601.         int iValue;
  5602. } NMIPADDRESS, *LPNMIPADDRESS;
  5603.  
  5604. // The following is a useful macro for passing the range values in the
  5605. // IPM_SETRANGE message.
  5606.  
  5607. #define MAKEIPRANGE(low, high)    ((LPARAM)(WORD)(((BYTE)(high) << 8) + (BYTE)(low)))
  5608.  
  5609. // And this is a useful macro for making the IP Address to be passed
  5610. // as a LPARAM.
  5611.  
  5612. #define MAKEIPADDRESS(b1,b2,b3,b4)  ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4))))
  5613.  
  5614. // Get individual number
  5615. #define FIRST_IPADDRESS(x)  ((x>>24) & 0xff)
  5616. #define SECOND_IPADDRESS(x) ((x>>16) & 0xff)
  5617. #define THIRD_IPADDRESS(x)  ((x>>8) & 0xff)
  5618. #define FOURTH_IPADDRESS(x) (x & 0xff)
  5619.  
  5620.  
  5621. #endif // NOIPADDRESS
  5622.  
  5623.  
  5624. //---------------------------------------------------------------------------------------
  5625. //---------------------------------------------------------------------------------------
  5626. ///  ====================== Pager Control =============================
  5627. //---------------------------------------------------------------------------------------
  5628. //---------------------------------------------------------------------------------------
  5629.  
  5630. #ifndef NOPAGESCROLLER
  5631.  
  5632. //Pager Class Name
  5633. #define WC_PAGESCROLLERW           L"SysPager"
  5634. #define WC_PAGESCROLLERA           "SysPager"
  5635.  
  5636. #ifdef UNICODE
  5637. #define WC_PAGESCROLLER          WC_PAGESCROLLERW
  5638. #else
  5639. #define WC_PAGESCROLLER          WC_PAGESCROLLERA
  5640. #endif
  5641.  
  5642.  
  5643. //---------------------------------------------------------------------------------------
  5644. // Pager Control Styles
  5645. //---------------------------------------------------------------------------------------
  5646. #define PGS_VERT                0x00000000
  5647. #define PGS_HORZ                0x00000001
  5648. #define PGS_AUTOSCROLL          0x00000002
  5649. #define PGS_DRAGNDROP           0x00000004
  5650.  
  5651.  
  5652. //---------------------------------------------------------------------------------------
  5653. // Pager Button State
  5654. //---------------------------------------------------------------------------------------
  5655. //The scroll can be in one of the following control State 
  5656. #define  PGF_INVISIBLE   0      // Scroll button is not visible
  5657. #define  PGF_NORMAL      1      // Scroll button is in normal state
  5658. #define  PGF_GRAYED      2      // Scroll button is in grayed state
  5659. #define  PGF_DEPRESSED   4      // Scroll button is in depressed state
  5660. #define  PGF_HOT         8      // Scroll button is in hot state
  5661.  
  5662.  
  5663. // The following identifiers specifies the button control 
  5664. #define PGB_TOPORLEFT       0
  5665. #define PGB_BOTTOMORRIGHT   1
  5666.  
  5667. //---------------------------------------------------------------------------------------
  5668. // Pager Control  Messages
  5669. //---------------------------------------------------------------------------------------
  5670. #define PGM_SETCHILD            (PGM_FIRST + 1)  // lParam == hwnd
  5671. #define Pager_SetChild(hwnd, hwndChild) \
  5672.         (void)SNDMSG((hwnd), PGM_SETCHILD, 0, (LPARAM)(hwndChild))
  5673.  
  5674. #define PGM_RECALCSIZE          (PGM_FIRST + 2)
  5675. #define Pager_RecalcSize(hwnd) \
  5676.         (void)SNDMSG((hwnd), PGM_RECALCSIZE, 0, 0)
  5677.  
  5678. #define PGM_FORWARDMOUSE        (PGM_FIRST + 3)
  5679. #define Pager_ForwardMouse(hwnd, bForward) \
  5680.         (void)SNDMSG((hwnd), PGM_FORWARDMOUSE, (WPARAM)(bForward), 0)
  5681.  
  5682. #define PGM_SETBKCOLOR          (PGM_FIRST + 4)
  5683. #define Pager_SetBkColor(hwnd, clr) \
  5684.         (COLORREF)SNDMSG((hwnd), PGM_SETBKCOLOR, 0, (LPARAM)clr)
  5685.  
  5686. #define PGM_GETBKCOLOR          (PGM_FIRST + 5)
  5687. #define Pager_GetBkColor(hwnd) \
  5688.         (COLORREF)SNDMSG((hwnd), PGM_GETBKCOLOR, 0, 0)
  5689.  
  5690. #define PGM_SETBORDER          (PGM_FIRST + 6)
  5691. #define Pager_SetBorder(hwnd, iBorder) \
  5692.         (int)SNDMSG((hwnd), PGM_SETBORDER, 0, (LPARAM)iBorder)
  5693.  
  5694. #define PGM_GETBORDER          (PGM_FIRST + 7)
  5695. #define Pager_GetBorder(hwnd) \
  5696.         (int)SNDMSG((hwnd), PGM_GETBORDER, 0, 0)
  5697.  
  5698. #define PGM_SETPOS              (PGM_FIRST + 8)
  5699. #define Pager_SetPos(hwnd, iPos) \
  5700.         (int)SNDMSG((hwnd), PGM_SETPOS, 0, (LPARAM)iPos)
  5701.  
  5702. #define PGM_GETPOS              (PGM_FIRST + 9)
  5703. #define Pager_GetPos(hwnd) \
  5704.         (int)SNDMSG((hwnd), PGM_GETPOS, 0, 0)
  5705.  
  5706. #define PGM_SETBUTTONSIZE       (PGM_FIRST + 10)
  5707. #define Pager_SetButtonSize(hwnd, iSize) \
  5708.         (int)SNDMSG((hwnd), PGM_SETBUTTONSIZE, 0, (LPARAM)iSize)
  5709.  
  5710. #define PGM_GETBUTTONSIZE       (PGM_FIRST + 11)
  5711. #define Pager_GetButtonSize(hwnd) \
  5712.         (int)SNDMSG((hwnd), PGM_GETBUTTONSIZE, 0,0)
  5713.  
  5714. #define PGM_GETBUTTONSTATE      (PGM_FIRST + 12)
  5715. #define Pager_GetButtonState(hwnd, iButton) \
  5716.         (DWORD)SNDMSG((hwnd), PGM_GETBUTTONSTATE, 0, (LPARAM)iButton)
  5717.  
  5718. #define PGM_GETDROPTARGET       CCM_GETDROPTARGET
  5719. #define Pager_GetDropTarget(hwnd, ppdt) \
  5720.         (void)SNDMSG((hwnd), PGM_GETDROPTARGET, 0, (LPARAM)ppdt)
  5721.  
  5722. //---------------------------------------------------------------------------------------
  5723. //Pager Control Notification Messages
  5724. //---------------------------------------------------------------------------------------
  5725.  
  5726.  
  5727. // PGN_SCROLL Notification Message
  5728.  
  5729. #define PGN_SCROLL          (PGN_FIRST-1)
  5730.  
  5731. #define PGF_SCROLLUP        1
  5732. #define PGF_SCROLLDOWN      2
  5733. #define PGF_SCROLLLEFT      4
  5734. #define PGF_SCROLLRIGHT     8
  5735.  
  5736.  
  5737. //Keys down
  5738. #define PGK_SHIFT           1
  5739. #define PGK_CONTROL         2
  5740. #define PGK_MENU            4
  5741.  
  5742.  
  5743. // This structure is sent along with PGN_SCROLL notifications
  5744. typedef struct {
  5745.     NMHDR hdr;
  5746.     WORD fwKeys;            // Specifies which keys are down when this notification is send
  5747.     RECT rcParent;          // Contains Parent Window Rect
  5748.     int  iDir;              // Scrolling Direction
  5749.     int  iXpos;             // Horizontal scroll position
  5750.     int  iYpos;             // Vertical scroll position
  5751.     int  iScroll;           // [in/out] Amount to scroll
  5752. }NMPGSCROLL, *LPNMPGSCROLL;
  5753.  
  5754.  
  5755. // PGN_CALCSIZE Notification Message
  5756.  
  5757. #define PGN_CALCSIZE        (PGN_FIRST-2)
  5758.  
  5759. #define PGF_CALCWIDTH       1
  5760. #define PGF_CALCHEIGHT      2
  5761.  
  5762. typedef struct {
  5763.     NMHDR   hdr;
  5764.     DWORD   dwFlag;
  5765.     int     iWidth;
  5766.     int     iHeight;
  5767. }NMPGCALCSIZE, *LPNMPGCALCSIZE;
  5768.  
  5769. #endif // NOPAGESCROLLER
  5770.  
  5771. ////======================  End Pager Control ==========================================
  5772.  
  5773. //
  5774. // === Native Font Control ===
  5775. //
  5776. #ifndef NONATIVEFONTCTL
  5777. //NativeFont Class Name
  5778. #define WC_NATIVEFONTCTLW           L"NativeFontCtl"
  5779. #define WC_NATIVEFONTCTLA           "NativeFontCtl"
  5780.  
  5781. #ifdef UNICODE
  5782. #define WC_NATIVEFONTCTL          WC_NATIVEFONTCTLW
  5783. #else
  5784. #define WC_NATIVEFONTCTL          WC_NATIVEFONTCTLA
  5785. #endif
  5786.  
  5787. // style definition
  5788. #define NFS_EDIT                0x0001
  5789. #define NFS_STATIC              0x0002
  5790. #define NFS_LISTCOMBO           0x0004
  5791. #define NFS_BUTTON              0x0008
  5792. #define NFS_ALL                 0x0010
  5793.  
  5794. #endif // NONATIVEFONTCTL
  5795. // === End Native Font Control ===
  5796.  
  5797. #endif      // _WIN32_IE >= 0x0400
  5798.  
  5799. #ifdef _WIN32
  5800. //====== TrackMouseEvent  =====================================================
  5801.  
  5802. #ifndef NOTRACKMOUSEEVENT
  5803.  
  5804. //
  5805. // If the messages for TrackMouseEvent have not been defined then define them
  5806. // now.
  5807. //
  5808. #ifndef WM_MOUSEHOVER
  5809. #define WM_MOUSEHOVER                   0x02A1
  5810. #define WM_MOUSELEAVE                   0x02A3
  5811. #endif
  5812.  
  5813. //
  5814. // If the TRACKMOUSEEVENT structure and associated flags havent been declared
  5815. // then declare them now.
  5816. //
  5817. #ifndef TME_HOVER
  5818.  
  5819. #define TME_HOVER       0x00000001
  5820. #define TME_LEAVE       0x00000002
  5821. #define TME_QUERY       0x40000000
  5822. #define TME_CANCEL      0x80000000
  5823.  
  5824.  
  5825. #define HOVER_DEFAULT   0xFFFFFFFF
  5826.  
  5827. typedef struct tagTRACKMOUSEEVENT {
  5828.     DWORD cbSize;
  5829.     DWORD dwFlags;
  5830.     HWND  hwndTrack;
  5831.     DWORD dwHoverTime;
  5832. } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
  5833.  
  5834. #endif // !TME_HOVER
  5835.  
  5836. //
  5837. // Declare _TrackMouseEvent.  This API tries to use the window manager's
  5838. // implementation of TrackMouseEvent if it is present, otherwise it emulates.
  5839. //
  5840. WINCOMMCTRLAPI
  5841. BOOL
  5842. WINAPI
  5843. _TrackMouseEvent(
  5844.     LPTRACKMOUSEEVENT lpEventTrack);
  5845.  
  5846. #endif // !NOTRACKMOUSEEVENT
  5847.  
  5848. #if (_WIN32_IE >= 0x0400)
  5849.  
  5850. //====== Flat Scrollbar APIs=========================================
  5851. #ifndef NOFLATSBAPIS
  5852.  
  5853. #define WSB_PROP_CYVSCROLL  0x00000001L
  5854. #define WSB_PROP_CXHSCROLL  0x00000002L
  5855. #define WSB_PROP_CYHSCROLL  0x00000004L
  5856. #define WSB_PROP_CXVSCROLL  0x00000008L
  5857. #define WSB_PROP_CXHTHUMB   0x00000010L
  5858. #define WSB_PROP_CYVTHUMB   0x00000020L
  5859. #define WSB_PROP_VBKGCOLOR  0x00000040L
  5860. #define WSB_PROP_HBKGCOLOR  0x00000080L
  5861. #define WSB_PROP_VSTYLE     0x00000100L
  5862. #define WSB_PROP_HSTYLE     0x00000200L
  5863. #define WSB_PROP_WINSTYLE   0x00000400L
  5864. #define WSB_PROP_PALETTE    0x00000800L
  5865. #define WSB_PROP_MASK       0x00000FFFL
  5866.  
  5867. #define FSB_FLAT_MODE           2
  5868. #define FSB_ENCARTA_MODE        1
  5869. #define FSB_REGULAR_MODE        0
  5870.  
  5871. WINCOMMCTRLAPI BOOL WINAPI FlatSB_EnableScrollBar(HWND, int, UINT);
  5872. WINCOMMCTRLAPI BOOL WINAPI FlatSB_ShowScrollBar(HWND, int code, BOOL);
  5873.  
  5874. WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollRange(HWND, int code, LPINT, LPINT);
  5875. WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollInfo(HWND, int code, LPSCROLLINFO);
  5876. WINCOMMCTRLAPI int WINAPI FlatSB_GetScrollPos(HWND, int code);
  5877. WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollProp(HWND, int propIndex, LPINT);
  5878.  
  5879. WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollPos(HWND, int code, int pos, BOOL fRedraw);
  5880. WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollInfo(HWND, int code, LPSCROLLINFO, BOOL fRedraw);
  5881. WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollRange(HWND, int code, int min, int max, BOOL fRedraw);
  5882. WINCOMMCTRLAPI BOOL WINAPI FlatSB_SetScrollProp(HWND, UINT index, int newValue, BOOL);
  5883.  
  5884. WINCOMMCTRLAPI BOOL WINAPI InitializeFlatSB(HWND);
  5885. WINCOMMCTRLAPI HRESULT WINAPI UninitializeFlatSB(HWND);
  5886.  
  5887. #endif  //  NOFLATSBAPIS
  5888.  
  5889. #endif      // _WIN32_IE >= 0x0400
  5890.  
  5891. #endif /* _WIN32 */
  5892.  
  5893. #endif      // _WIN32_IE >= 0x0300
  5894.  
  5895.  
  5896. #ifdef __cplusplus
  5897. }
  5898. #endif
  5899.  
  5900. #ifdef _WIN32
  5901. #include <poppack.h>
  5902. #endif
  5903.  
  5904. #endif
  5905.  
  5906. #pragma option pop
  5907. #endif  // _INC_COMMCTRL
  5908.